代码如下所示:
package main import ( "github.com/thinkerou/favicon" "fmt" "github.com/gin-gonic/gin" ) func main() { r := gin.Default()//设置标签页的logo r.Use(favicon.New("./favicon.ico")) // 运行目录下的favicon.ico err :=r.Run(":8887") if err!=nil{ fmt.Println("error") } }