moneyfloat

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package moneyfloat 检查 float32/float64 在业务代码中的出现。

报告位置:struct 字段类型、变量/常量声明类型、函数参数与返回值、显式类型转换。 金额与业务数值必须用 money.Money 或 decimal 表示(见 appkit docs/DESIGN.md §7)。

本检查器故意不区分"金额"与"合法的数学计算"——time 换算等场景里的 float 同样会被报告。用 -scope 正则把检查圈定在业务包(如 internal/ledger), 而不是给检查器加豁免启发式。

默认只查生产代码(_test.go 不查),-tests=true 连测试一起查。

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "moneyfloat",
	Doc:  "禁止 float32/float64 出现在 struct 字段、变量/常量声明、函数参数与返回值、显式类型转换中;金额与业务数值改用 money.Money 或 decimal",
	Run:  run,
}

Analyzer 是 moneyfloat 检查器。

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL