package
0.0.0-20231208061952-f10d33120ced
Repository: https://github.com/liguoqinjim/go-labs.git
Documentation: pkg.go.dev

# README

得到完整url

注意点

  • golang里面不能直接得到完成的链接,需要自己来拼接出完整的链接
  • 这里是通过request.TLS是否为空来判断是http还是https的,为空的时候是http

运行结果

先访问http://localhost:9090/index?id=1

Imgur

参考资料

http://www.01happy.com/golang-get-full-url/