diff --git a/internal/lang/funcs/cidr_test.go b/internal/lang/funcs/cidr_test.go index 524653111..cb8d810a9 100644 --- a/internal/lang/funcs/cidr_test.go +++ b/internal/lang/funcs/cidr_test.go @@ -246,7 +246,7 @@ func TestCidrSubnet(t *testing.T) { }, { // fractions are Not Ok cty.StringVal("10.256.0.0/8"), - cty.NumberFloatVal(2 / 3), + cty.NumberFloatVal(2.0 / 3.0), cty.NumberFloatVal(.75), cty.UnknownVal(cty.String), true, diff --git a/internal/plugin/discovery/find.go b/internal/plugin/discovery/find.go index f053312b0..027a887eb 100644 --- a/internal/plugin/discovery/find.go +++ b/internal/plugin/discovery/find.go @@ -154,9 +154,7 @@ func ResolvePluginPaths(paths []string) PluginMetaSet { // Trim the .exe suffix used on Windows before we start wrangling // the remainder of the path. - if strings.HasSuffix(baseName, ".exe") { - baseName = baseName[:len(baseName)-4] - } + baseName = strings.TrimSuffix(baseName, ".exe") parts := strings.SplitN(baseName, "_v", 2) name := parts[0] diff --git a/scripts/staticcheck.sh b/scripts/staticcheck.sh index 66c47092f..2dd08309a 100755 --- a/scripts/staticcheck.sh +++ b/scripts/staticcheck.sh @@ -13,4 +13,4 @@ packages=$(go list ./... | egrep -v ${skip}) # We are skipping style-related checks, since terraform intentionally breaks # some of these. The goal here is to find issues that reduce code clarity, or # may result in bugs. -staticcheck -checks 'all,-ST*' ${packages} +go run honnef.co/go/tools/cmd/staticcheck -checks 'all,-ST*' ${packages}