- With issues:
- Use the search tool before opening a new issue.
- Please provide source code and commit sha if you found a bug.
- Review existing issues and provide feedback or react to them.
Description
How to reproduce
package main
import (
"github.com/gin-gonic/gin"
)
func main() {
g := gin.Default()
g.GET("/hello/:name", func(c *gin.Context) {
c.String(200, "Hello %s", c.Param("name"))
})
g.Run(":9000")
}
Expectations
$ curl http://localhost:9000/hello/world
Hello world
Actual result
$ curl -i http://localhost:9000/hello/world
<YOUR RESULT>
Environment
- go version:
go version go1.21.0 darwin/amd64
- gin version (or commit ref):
go install github.com/gin-gonic/gin@latest
go: downloading github.com/gin-gonic/gin v1.9.1
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading golang.org/x/net v0.10.0
go: downloading github.com/mattn/go-isatty v0.0.19
go: downloading github.com/go-playground/validator/v10 v10.14.0
go: downloading github.com/ugorji/go/codec v1.2.11
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading google.golang.org/protobuf v1.30.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/gabriel-vasile/mimetype v1.4.2
go: downloading golang.org/x/crypto v0.9.0
go: downloading github.com/leodido/go-urn v1.2.4
go: downloading github.com/go-playground/universal-translator v0.18.1
go: downloading golang.org/x/text v0.9.0
go: downloading github.com/go-playground/locales v0.14.1
go/pkg/mod/github.com/go-playground/validator/v10@v10.14.0/baked_in.go:25:2: github.com/gabriel-vasile/mimetype@v1.4.2: read "https:/proxy.golang.org/@v/v1.4.2.zip": local error: tls: bad record MAC
package github.com/gin-gonic/gin is not a main package
- operating system:
zzg@desktop % sw_vers
ProductName: macOS
ProductVersion: 13.5.1
BuildVersion: 22G90
Comment From: jooyyy
This seems the error from your proxy and local network.
Comment From: VarusHsu
Hi, you should run
go get -u github.com/gin-gonic/gin
instead of
go install github.com/gin-gonic/gin@latest
A golang project that have main package can be go install
but gin not.