別ファイルに書いた main パッケージの Function が undefined 判定される

ここに答えがあった

Please read “How to Write Go Code”.

Use go build or go install within the package directory, or supply an import path for the package. Do not use file arguments for build or install.

While you can use file arguments for go run, you should build a package instead, usually with go run ., though you should almost always use go install, or go build.

go run main.go としていたが、ファイル名指定する場合、go install or go build すべき

go run . で良いらしいので、シンプルだしこっちでいいな