gopm

gopm是Go语言的包管理工具,主要用于在国内网络环境下解决无法直接获取golang.org依赖的问题。通过gopm可以方便地下载和安装依赖,包括手动从GitHub查找和使用gopm命令行工具。首先需要安装git,然后进行gopm的测试安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

gopm

一、介绍

在使用go语言中常常需要使用到官方的依赖,而在国内网络环境的原因无法直接获取到golang.org中的依赖

  1. 安装使用gopm去下载(这里采用的)

  2. 手动去github找到官网的依赖去下载

    golang在github托管依赖

二、下载

需要安装git

C:\Users\yimt>go get -v github.com/gpmgo/gopm
github.com/gpmgo/gopm (download)
github.com/Unknwon/com (download)
github.com/gpmgo/gopm/modules/cae
github.com/gpmgo/gopm/modules/log
github.com/gpmgo/gopm/modules/goconfig
github.com/gpmgo/gopm/modules/cli
github.com/gpmgo/gopm/modules/base
github.com/Unknwon/com
github.com/gpmgo/gopm/modules/cae/zip
github.com/gpmgo/gopm/modules/setting
github.com/gpmgo/gopm/modules/errors
github.com/gpmgo/gopm/modules/doc
github.com/gpmgo/gopm/cmd
github.com/gpmgo/gopm/lib
github.com/gpmgo/gopm

测试安装完成

# 输入gopm有命令提示代表成功,否则失败
C:\Users\yimt>gopm
NAME:
   Gopm - Go Package Manager

USAGE:
   Gopm [global options] command [command options] [arguments...]

VERSION:
   0.8.8.0307 Beta

COMMANDS:
   list         list all dependencies of current project
   gen          generate a gopmfile for current Go project
   get          fetch remote package(s) and dependencies
   bin          download and link dependencies and build binary
   config       configure gopm settings
   run          link dependencies and go run
   test         link dependencies and go test
   build        link dependencies and go build
   install      link dependencies and go install
   clean        clean all temporary files
   update       check and update gopm resources including itself
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --noterm, -n         disable color output
   --strict, -s         strict mode
   --debug, -d          debug mode
   --help, -h           show help
   --version, -v        print the version

三、使用

gopm get -g -v golang.org/x/tools/cmd/goimports
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值