go
compilation
ai_generated
true
undefined: functionName
ID: go/undefined-reference
96%Fix Rate
97%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 121 | active | — | — | — |
| 1 | active | — | — | — |
Root Cause
Function or variable not defined in the current package or not exported (lowercase first letter).
genericWorkarounds
-
95% success Ensure the function starts with uppercase to be exported: MyFunc not myFunc
Only uppercase-initial identifiers are exported in Go
-
88% success Check build tags and file suffixes (_test.go, _linux.go) that may exclude the file
Files with build constraints may not be compiled in your environment
Dead Ends
Common approaches that don't work:
-
Adding the function to a different package without importing
80% fail
Go requires explicit imports between packages
-
Using go:linkname to access unexported symbols
90% fail
Compiler hack; breaks with Go version updates
Error Chain
Frequently confused with: