package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/gin-gonic/gin"
)
// Phone asd
type Phone interface {
call()
}
// MiPhone asd
type MiPhone struct {
}
go env -w GOPROXY=https://goproxy.cn,direct
go mod init api
go get -u github.com/gin-gonic/gin
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func main() {
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"net/http"
)
type User struct {
Name string `json:"name"`
Age int `json:"age"`
}
func main() {
r := gin.Default()
| - src
- index.go
- libs
- index.go
libs / index.go
package libs // 属于哪个包
// 方法名 首字母 大写才能导出
func Count( a int, b int ) int {
return a + b
}
index.go