-
-
Notifications
You must be signed in to change notification settings - Fork 402
Closed
Labels
Description
Minimal code to represent issue
type A string
type B struct {
A `json:"a"`
}
func TestXXX(t *testing.T) {
x := B{}
// struct type 'B' doesn't have any exported fields,
// nor custom marshaling (SA9005)go-staticcheck
b, _ := json.Marshal(x)
fmt.Printf("%s\n", string(b))
}staticcheck -version
staticcheck 2023.1.5 (v0.4.5)
staticcheck -debug.version
staticcheck 2023.1.5 (v0.4.5)
Compiled with Go version: go1.20.4
Main module:
honnef.co/go/[email protected] (sum: h1:YGD4H+SuIOOqsyoLOpZDWcieM28W47/zRO7f+9V3nvo=)
Dependencies:
github.com/BurntSushi/[email protected] (sum: h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=)
golang.org/x/exp/[email protected] (sum: h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE=)
golang.org/x/[email protected] (sum: h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=)
golang.org/x/[email protected] (sum: h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=)
golang.org/x/[email protected] (sum: h1:mqZawFxUzsv+YVwGQO30cZegeV/YD6dAwsdGxi0tQQg=)
go version
go version go1.20.4 darwin/arm64
go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/kolesnik/Library/Caches/go-build"
GOENV="/Users/kolesnik/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/kolesnik/devel/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/kolesnik/devel/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/kolesnik/devel/go/src/github.com/fogfish/schemaorg/schemaext/go.mod"
GOWORK="/Users/kolesnik/devel/go/src/github.com/fogfish/schemaorg/go.work"
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/98/0ttsxqrn6q13jwh9shqc30jr0000gn/T/go-build2539534517=/tmp/go-build -gno-record-gcc-switches -fno-common"