dongpei3245
2015-08-03 18:23
浏览 90

如何在golang中安装软件包

I try to connect to SQL server in golang, I searched in internet and through this address: https://github.com/denisenkom/go-mssqldb I understood that first I need to install a package for the purpose, but when I want to install this package through git terminal by entering this command:

$ go get github.com/denisenkom/go-mssqldb

I receive this error :

can't load package: package github.com/denisenkom/go-mssqldb: no buildable go source files in C:\Go\src\github.com\dnisenkom\go-mssqldb

my $GOPATH is already set.I don't know how to fix this problem ...

图片转代码服务由CSDN问答提供 功能建议

我尝试在golang中连接到SQL Server,我在互联网上搜索并通过以下地址进行搜索: https://github.com/denisenkom/go-mssqldb 我了解,首先我需要为此安装一个软件包 ,但是当我想通过输入以下命令通过git终端安装该软件包时:

$ go get github.com/denisenkom/go-mssqldb

我收到此错误:

无法加载包:包github.com/denisenkom/go-mssqldb:C:\ Go \ src \ github.com中没有可生成的go源文件 \ dnisenkom \ go-mssqldb

我的$ GOPATH已设置。我不知道如何解决此问题...

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douwei3280 2015-08-03 20:24
    已采纳

    According to the golang website:

    Get downloads and installs the packages named by the import paths, along with their dependencies.

    It sounds like the download isn't working, which is causing the folder to be empty. One alternative is to download the driver as a zip file and run go install on the folder.

    点赞 打赏 评论

相关推荐 更多相似问题