DiagnosticsError codes
M0024 name not exported
The name exists in the package but starts with a lower case letter, so only that package can use it.
example $ marmot build . error[M0024]: name indexFunc not exported by package strings --> ./main.go:10:15 | 10 | i := strings.indexFunc(s, unicode.IsSpace) | ^^^^^^^^^ unexported: only package `strings` can use it | help: use `strings.IndexFunc` (check it) | 10 - i := strings.indexFunc(s, unicode.IsSpace) 10 + i := strings.IndexFunc(s, unicode.IsSpace) | error[M0009]: not enough arguments in call to strings.indexFunc --> ./main.go:10:43 | 10 | i := strings.indexFunc(s, unicode.IsSpace) | ^ missing arguments | = note: expected `(string, func(rune) bool, bool)`, found `(string, func(r rune) bool)` = note: `strings.indexFunc` is declared as `func indexFunc(s string, f func(rune) bool, truth bool) int` error: build failed with 2 errors for more about an error, run `marmot explain M0009`
The program that produced it
package main
import (
"strings"
"unicode"
)
func main() {
s := "hello, marmot"
i := strings.indexFunc(s, unicode.IsSpace)
_ = i
}
The mistake and the fix
i := strings.indexFunc(s, unicode.IsSpace)i := strings.IndexFunc(s, unicode.IsSpace) The fix
Use the exported name (upper case first letter).
See also all error codes and marmot explain.