[GIN-debug] Environment variable PORT is undefined. Using port :8080 by default
[GIN-debug] Listening and serving HTTP on :8080

此时运行的run是:

r.Run()

修改r.Run():

r.Run("127.0.0.1:8080")

运行就不再需要确认防火墙
debug:
在这里插入图片描述

[GIN-debug] Listening and serving HTTP on 127.0.0.1:8080
				
要实现一个 API 服务器,首先要考虑两个方面:API 风格和媒体类型。Go 语言中常用的 API 风格是 RPC 和 REST,常用的媒体类型是 JSON、XML 和 Protobuf。在 Go API 开发中常用的组合是 gRPC+Protobuf 和 REST+JSON。 1. 安装 Gin是一个用 Go(Golang)编写的 web框架。要安装 Gin包,你需要先安装 Go并设置你的 Go工作空间。 首先需要安装 Go(需要1.13以上版本),然后你可以使用下面的 Go命令来安装 Gin。 [GIN-debug] Listening and serving HTTP on :8080 [GIN-debug] Listening and serving HTTP on 127.0.0.1:8080 启动的时候不要只写端口,而是把本地IP也写进去,就不会弹出这个警告
文章目录1. 安装graphviz1.1 下载 graphviz (windows 环境)1.2 测试graphviz是否安装成功2. 使用pprof2.1 修改代码2.2 火焰图生成3. Gin框架使用pprof3.1 安装需要包3.2 启动程序3.3 火焰图3.4 pprof命令行参考文档 1. 安装graphviz 1.1 下载 graphviz (windows 环境) https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38
题目:codevs 1128 导弹拦截 题解: 这题简略看了一下真没啥思路,而且是2010年的普及题目啊!!瞬间感觉智商回到西元前(雾)。然后就想只有两个,每一个导弹只有两种选择,给一号拦截或者二号拦截,枚举?2^n,好像当年给了20分,数据范围如下: 对于10%的数据,N = 1 对于20%的数据,1 ≤ N ≤ 2 对于40%的数据,1 ≤ N ≤ 100 对于70%
Gin 是使用纯 Golang 语言实现的 HTTP Web 框架,Gin 的接口设计简洁,性能极高,现在被广泛使用。我司的 Web 后端服务基本是都是基于 Gin 开发的。 首次使用 Gin 框架时,需要先进行安装,命令如下: go get -u github.com/gin-gonic/gin 可能会出现如下报错信息: # cd .; git clone -- https://github.com/gin-contrib/sse /Us
2. 然后,克隆Golang官方的tools包到上一步创建的两个目录: $ git clone https://github.com/golang/tools.git github.com/golang/tools $ git clone https://github.com/golang/tools.git golang.org/x/tools 3. 最后,参考Golang官网的安装方法,使用dnf方式安装Visual Studio Code: sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' dnf check-update sudo dnf install code