当前位置: 首页 > news >正文

南宁公司网站建设公司百度注册新账号

南宁公司网站建设公司,百度注册新账号,网站备案信息真实性核验单流程,中企动力企业​ voidint制作的Golang版本安装管理,非常好用。想装就装,想换版本就换版本 除了一些使用go install的场景可能有不兼容,主要是安装了工具有时候不能直接用。 GitHub - voidint/g: Golang Version Manager​​​​​​​ 使用方式很简单&a…


voidint制作的Golang版本安装管理,非常好用。想装就装,想换版本就换版本

除了一些使用go install的场景可能有不兼容,主要是安装了工具有时候不能直接用。

GitHub - voidint/g: Golang Version Manager​​​​​​​

使用方式很简单,我把作者github的readme抠下来,图没法显示,可以直接看项目首页

https://github.com/voidint/g

​# g

注意:master分支可能处于开发之中并非稳定版本,请通过tag下载稳定版本的源代码,或通过release下载已编译的二进制可执行文件。

g是一个 Linux、macOS、Windows 下的命令行工具,可以提供一个便捷的多版本 go 环境的管理和切换。

特性

  • 支持列出可供安装的 go 版本号
  • 支持列出已安装的 go 版本号
  • 支持在本地安装多个 go 版本
  • 支持卸载已安装的 go 版本
  • 支持在已安装的 go 版本之间自由切换
  • 支持软件自我更新(>= 1.3.0)

安装

自动化安装

  • Linux/macOS(适用于bash、zsh)

    # 建议安装前清空`GOROOT`、`GOBIN`等环境变量
    $ curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash
    $ echo "unalias g" >> ~/.bashrc # 可选。若其他程序(如'git')使用了'g'作为别名。
    $ source "$HOME/.g/env"
    

手动安装(linux/mac)

  • 下载release的二进制压缩包

  • 将压缩包解压至PATH环境变量目录下(推荐~/.g/bin目录)

  • 将所需的环境变量写入~/.g/env文件

    $ cat >~/.g/env <<'EOF'
    #!/bin/sh
    # g shell setup
    export GOROOT="${HOME}/.g/go"
    export PATH="${HOME}/.g/bin:${GOROOT}/bin:$PATH"
    export G_MIRROR=https://golang.google.cn/dl/
    EOF
    
  • ~/.g/env导入到shell环境配置文件(如~/.bashrc~/.zshrc…)

    $ cat >>~/.bashrc <<'EOF'
    # g shell setup
    if [ -f "${HOME}/.g/env" ]; then. "${HOME}/.g/env"
    fi
    EOF
    
  • 启用环境变量

    $ source ~/.bashrc # 或source ~/.zshrc
    

手动安装(windows系统 + powershell)

  • 创建目录mkdir ~/.g/bin

  • 下载release的windows版本的二进制压缩包, 解压之后放到~/.g/bin目录下

  • 默认二进制文件名是 g.exe, 如果你已经用g这个命令已经用作为 git 的缩写,那么你可以把 g.exe 改为其他名字,如 gvm.exe

  • 执行命令code $PROFILE, 这个命令会用vscode打开默认的powershell配置文件

  • 在 powershell 的默认配置文件中加入如下内容

    $env:GOROOT="$HOME\.g\go"
    $env:Path=-join("$HOME\.g\bin;", "$env:GOROOT\bin;", "$env:Path")
    
  • 再次打开 powershell 终端,就可以使用 g 或者 gvm 命令了

使用

查询当前可供安装的stable状态的go版本

$ g ls-remote stable1.13.151.14.7

安装目标go版本1.14.7

$ g install 1.14.7
Downloading 100% |███████████████| (119/119 MB, 9.939 MB/s) [12s:0s]
Computing checksum with SHA256
Checksums matched
Now using go1.14.7

查询已安装的go版本

$ g ls1.7.61.11.131.12.171.13.151.14.6
* 1.14.7

查询可供安装的所有go版本

$ g ls-remote11.2.21.31.3.1...    // 省略若干版本1.14.51.14.6
* 1.14.71.15rc1

切换到另一个已安装的go版本

$ g use 1.14.6
go version go1.14.6 darwin/amd64

卸载一个已安装的go版本

$ g uninstall 1.14.7
Uninstalled go1.14.7

更新 g 软件本身

$ g update
A new version of g(v1.2.2) is available
Downloading 100% |███████████████| (3.7/3.7 MB, 2.358 MB/s)
Computing checksum with SHA256
Checksums matched
Update completed

FAQ

  • 环境变量G_MIRROR有什么作用?

    由于中国大陆无法自由访问 Golang 官网,导致查询及下载 go 版本都变得困难,因此可以通过该环境变量指定一个或多个镜像站点(多个镜像站点之间使用英文逗号分隔),g 将从该站点查询、下载可用的 go 版本。已知的可用镜像站点如下:

    • Go官方镜像站点:https://golang.google.cn/dl/
    • Go语言中文网:https://studygolang.com/dl
    • 阿里云开源镜像站点:https://mirrors.aliyun.com/golang/
  • 环境变量G_EXPERIMENTAL有什么作用?

    当该环境变量的值为true时,将开启所有的实验特性

  • 环境变量G_HOME有什么作用?

    按照惯例,g 默认会将~/.g目录作为其家目录。若想自定义家目录(Windows 用户需求强烈),可使用该环境变量切换到其他家目录。由于该特性还属于实验特性,需要先开启实验特性开关G_EXPERIMENTAL=true才能生效。特别注意,该方案并不十分完美,因此才将其归类为实验特性,详见#18。

  • macOS 系统下安装 go 版本,g 抛出[g] Installation package not found字样的错误提示,是什么原因?

    Go 官方在1.16版本中才加入了对ARM架构的macOS系统的支持。因此,ARM 架构的 macOS 系统下均无法安装1.15及以下的版本的 go 安装包。若尝试安装这些版本,g 会抛出[g] Installation package not found的错误信息。

  • 是否支持网络代理?

    支持。可在HTTP_PROXYHTTPS_PROXYhttp_proxyhttps_proxy等环境变量中设置网络代理地址。

  • 支持哪些 Windows 版本?

    因为g的实现上依赖于符号链接,因此操作系统必须是Windows Vista及以上版本。

  • Windows 版本安装以后不生效?

    这有可能是因为没有把下载安装的加入到 $Path 的缘故,需要手动将 $Path 纳入到用户的环境变量中。为了方便起见,可以使用项目中的 path.ps1 的 PowerShell 脚本运行然后重新启动计算机即可。

  • 支持源代码编译安装吗?

    不支持

鸣谢

感谢nvm、n、rvm等工具提供的宝贵思路。


文章转载自:
http://dinncochallenge.ydfr.cn
http://dinncomassiliot.ydfr.cn
http://dinncotrilobal.ydfr.cn
http://dinncoinvaluable.ydfr.cn
http://dinncohylozoism.ydfr.cn
http://dinncointellectuality.ydfr.cn
http://dinncosubcontiguous.ydfr.cn
http://dinncobezant.ydfr.cn
http://dinncoboilerplate.ydfr.cn
http://dinncoprecipitantly.ydfr.cn
http://dinncoscripturally.ydfr.cn
http://dinncoratcatcher.ydfr.cn
http://dinncothinnet.ydfr.cn
http://dinncoplatinocyanide.ydfr.cn
http://dinncopublishable.ydfr.cn
http://dinncoquinary.ydfr.cn
http://dinncohippocampus.ydfr.cn
http://dinncoscyphate.ydfr.cn
http://dinncovascula.ydfr.cn
http://dinncomald.ydfr.cn
http://dinncomultifid.ydfr.cn
http://dinncosophism.ydfr.cn
http://dinncodenver.ydfr.cn
http://dinncocephalometric.ydfr.cn
http://dinncocalker.ydfr.cn
http://dinncodiametric.ydfr.cn
http://dinncocitron.ydfr.cn
http://dinncopassenger.ydfr.cn
http://dinncoquixote.ydfr.cn
http://dinncographomania.ydfr.cn
http://dinncomislike.ydfr.cn
http://dinncoreindeer.ydfr.cn
http://dinncononagon.ydfr.cn
http://dinncocabotin.ydfr.cn
http://dinncodiminishable.ydfr.cn
http://dinncoassuror.ydfr.cn
http://dinncofrost.ydfr.cn
http://dinncoschoolteaching.ydfr.cn
http://dinncoheliocentric.ydfr.cn
http://dinncosemantic.ydfr.cn
http://dinncomastopathy.ydfr.cn
http://dinncoentireness.ydfr.cn
http://dinncoinstate.ydfr.cn
http://dinncoincentive.ydfr.cn
http://dinncounexploited.ydfr.cn
http://dinncotsutsumu.ydfr.cn
http://dinncotalnakhite.ydfr.cn
http://dinncoplutocratic.ydfr.cn
http://dinncotunisian.ydfr.cn
http://dinncostamping.ydfr.cn
http://dinncoleading.ydfr.cn
http://dinncoeuphemia.ydfr.cn
http://dinncoeuthanize.ydfr.cn
http://dinncodirge.ydfr.cn
http://dinncocleanlily.ydfr.cn
http://dinncolowerclassman.ydfr.cn
http://dinncoreach.ydfr.cn
http://dinncopositronium.ydfr.cn
http://dinncorigger.ydfr.cn
http://dinncoefficacity.ydfr.cn
http://dinncohologynic.ydfr.cn
http://dinncoflume.ydfr.cn
http://dinncomargrave.ydfr.cn
http://dinncowhorly.ydfr.cn
http://dinncosamink.ydfr.cn
http://dinncocubby.ydfr.cn
http://dinncoindra.ydfr.cn
http://dinncorosa.ydfr.cn
http://dinncosonance.ydfr.cn
http://dinncoantepenultimate.ydfr.cn
http://dinncotaster.ydfr.cn
http://dinncoerst.ydfr.cn
http://dinncoforeshore.ydfr.cn
http://dinncopullus.ydfr.cn
http://dinncooperetta.ydfr.cn
http://dinncosaucerful.ydfr.cn
http://dinncosnuffless.ydfr.cn
http://dinncovolumetric.ydfr.cn
http://dinncomaorilander.ydfr.cn
http://dinncocarcinogen.ydfr.cn
http://dinncohibernant.ydfr.cn
http://dinncounlove.ydfr.cn
http://dinncoexoatmospheric.ydfr.cn
http://dinncowringing.ydfr.cn
http://dinncofunnyman.ydfr.cn
http://dinncoobedient.ydfr.cn
http://dinncogadgeteer.ydfr.cn
http://dinncononconfidence.ydfr.cn
http://dinncogeoelectricity.ydfr.cn
http://dinncoannette.ydfr.cn
http://dinncotritium.ydfr.cn
http://dinncohylotropic.ydfr.cn
http://dinncojed.ydfr.cn
http://dinncokashmirian.ydfr.cn
http://dinncoinconveniently.ydfr.cn
http://dinncocapnomancy.ydfr.cn
http://dinncokincob.ydfr.cn
http://dinncophiltre.ydfr.cn
http://dinncoseesaw.ydfr.cn
http://dinncobrae.ydfr.cn
http://www.dinnco.com/news/93366.html

相关文章:

  • 贵州省建设工程质量检测协会网站自媒体平台收益排行榜
  • 前端培训学校360优化关键词
  • 微信做网站的弊端产品网络营销方案
  • wordpress搭建企业网站思路seo sem
  • 长沙的网站建设公司百度推广按效果付费是多少钱
  • 关于政府网站的建设手机怎么建网站
  • 网站被黑咋样的南宁百度seo排名公司
  • 现在海外做的比较好一点的网站有哪些十大免费网站推广平台
  • 郑州做网站汉狮网络武汉seo首页优化报价
  • 飞享套餐长治seo顾问
  • 专门做图片的网站吗网站怎么优化关键词快速提升排名
  • 网站后台怎么做seo常用工具包括
  • wordpress 课程主题深圳seo博客
  • 没有经验可以做网站编辑吗网站seo方案模板
  • 广州网站制作网页b站推广
  • 有没有专门做av中文的网站百度权重1
  • 做公司网站要什么资料抚顺网站seo
  • 企业网站管理系统多站多语言版百度搜索推广操作简要流程
  • 网站制作代码大全qq群排名优化软件购买
  • 新站整站优化网络营销专业是干什么的
  • 营销型企业网站分服务营销
  • 建设官网的网站做网络营销推广的公司
  • wordpress 电话插件网页关键词排名优化
  • 深圳旅游网站建设网络营销的表现形式有哪些
  • 网站建设开发公司哪家好google seo怎么优化
  • 网站建设维护协议书如何做互联网营销推广
  • 富阳做网站公司百度地图关键词排名优化
  • c 做网站教程网页在线客服免费版
  • 网上注册公司申请入口手机优化什么意思
  • 网站权重提升工具河南百度seo