go:mytestのsrcディレクトリにパッケージパスを作成します
mytest.goを作成します
package mytest
/*方法名首字母要大写*/
func NxyTest() {
fmt.Println("this is my test")
}
テストデモを書く
package main
import (
"fmt"
"mytest"
)
func main(){
fmt.Println("begin")
mytest.NxyTest()
}