zoukankan      html  css  js  c++  java
  • 通过脚本下载GO被墙或常用的相关包

    脚本描述

    脚本依赖环境:Windows,GO,GIT
    脚本将创建 temp 目录,并拷贝相关包到第一个 GOPATH 中
    可将脚本保存到本地自行添加被墙或者常用的包

    完整脚本代码

    @echo off
    
    setlocal enabledelayedexpansion
    set currentPath=%~dp0
    set tempDir=%currentPath%temp
    set str="%gopath%"
    for /f "delims=;, tokens=1,*" %%a in (%str%) do (
        set godir= %%a
    )
    REM gopath第一个目录
    set workPath=!godir!src
    echo GOPATH:%workPath%
    
    if not exist %tempDir% md %tempDir%
    
    if not exist %tempDir%grpc  (
        call git clone https://github.com/grpc/grpc-go %tempDir%grpc
        call xcopy %tempDir%grpc %workPath%google.golang.orggrpc /s /e /Q /Y /I
    )
    
    if not exist %tempDir%genproto  (
        call git clone https://github.com/google/go-genproto.git %tempDir%genproto
        call xcopy %tempDir%genproto %workPath%google.golang.orggenproto /s /e /Q /Y /I
    )
    
    if not exist %tempDir%
    et  (
        call git clone https://github.com/golang/net %tempDir%
    et
        call xcopy %tempDir%
    et %workPath%golang.orgx
    et /s /e /Q /Y /I
    )
    if not exist %tempDir%sys  (
        call git clone https://github.com/golang/sys %tempDir%sys
        call xcopy %tempDir%sys %workPath%golang.orgxsys /s /e /Q /Y /I
    )
    
    if not exist %tempDir%	ext  (
        call git clone https://github.com/golang/text.git %tempDir%	ext
        call xcopy %tempDir%	ext %workPath%golang.orgx	ext /s /e /Q /Y /I
    )
    
  • 相关阅读:
    2-Add Two Numbers
    1-Two Sum
    解决spark-shell输出日志过多的问题
    安装配置Hive
    src与bin版本的区别
    AES加密时抛出java.security.InvalidKeyException: Illegal key size or default parameters
    hosts文件修改问题
    Spark垃圾邮件分类(scala+java)
    Spark常用机器学习算法(scala+java)
    Spark自带Pi程序运行
  • 原文地址:https://www.cnblogs.com/morang/p/8878771.html
Copyright © 2011-2022 走看看