go自定义包

在go的src目录下创建包路径:mytest

创建mytest.go

package mytest

/*方法名首字母要大写*/
func NxyTest() {
    fmt.Println("this is my test")
}

编写测试demo

package main


import (
    "fmt"
    "mytest"
)

func main(){
    fmt.Println("begin")
    mytest.NxyTest()
}

猜你喜欢

转载自blog.csdn.net/woailp___2005/article/details/110468201