Go Swagger TypeError: Failed to fetch 错误

介绍

gin 使用swagger 测试接口错误

TypeError: Failed to fetch

解决方案

找到项目中的的docs.go文件

将host 改为你程序的端口和ip,例如localhost:8080。

可能你的BasePath不是/v2,所以需要改成你的BasePath,例如我的是api。

原文地址:https://www.cnblogs.com/aqgy12138/p/14755967.html