我的Go+语言初体验——基于Windows系统创建Go+语言环境

简介: 我的Go+语言初体验——基于Windows系统创建Go+语言环境

一、🔍 下载并安装Go环境

🧡 Go官网:https://golang.google.cn/

🎈 下载链接 🔗 https://golang.google.cn/dl/

下载go1.17.4.windows-amd64.msi版本

3ad3fb720cb54441923fd0ef3376525e.png

🖨 双击go1.17.4.windows-amd64.msi,进行安装。

傻瓜式“下一步”操作截图

aafc2d4a45dd485791155f5b5f5c743f.png

💖💖💖💖💖💖💖💖💖💖💖💖💖💖💖

912a84f40456498bbf6ac96b224ca3c1.png

💚💚💚💚💚💚💚💚💚💚💚💚💚💚💚💚

c5515f0ca32d4d1a9fd87af44aacd7e6.png

💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛

b0214345663244eb8ea06f35e5e47c2b.png

💙💙💙💙💙💙💙💙💙💙💙💙💙💙💙💙

134dc7cf093b46809fecdfbeea705c8e.png

💜💜💜💜💜💜💜💜💜💜💜💜💜💜💜💜

b5cf9f6e80a542aea51697674e1fb786.png

f1d8acdd43b6478dbf1293cb94d315ce.png安装Go完成后,在CMD中输入go,输出如下信息,则安装成功。

Microsoft Windows [版本 10.0.19042.1237]
(c) Microsoft Corporation。保留所有权利。
C:\Users\xyb>go
Go is a tool for managing Go source code.
Usage:
        go <command> [arguments]
The commands are:
        bug         start a bug report
        build       compile packages and dependencies
        clean       remove object files and cached files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         update packages to use new APIs
        fmt         gofmt (reformat) package sources
        generate    generate Go files by processing source
        get         add dependencies to current module and install them
        install     compile and install packages and dependencies
        list        list packages or modules
        mod         module maintenance
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         report likely mistakes in packages
Use "go help <command>" for more information about a command.
Additional help topics:
        buildconstraint build constraints
        buildmode       build modes
        c               calling between Go and C
        cache           build and test caching
        environment     environment variables
        filetype        file types
        go.mod          the go.mod file
        gopath          GOPATH environment variable
        gopath-get      legacy GOPATH go get
        goproxy         module proxy protocol
        importpath      import path syntax
        modules         modules, module versions, and more
        module-get      module-aware go get
        module-auth     module authentication using go.sum
        packages        package lists and patterns
        private         configuration for downloading non-public code
        testflag        testing flags
        testfunc        testing functions
        vcs             controlling version control with GOVCS
Use "go help <topic>" for more information about that topic.
C:\Users\xyb>

输入go version查看版本信息。

C:\Users\xyb\Desktop\Go+\gop>go version
go version go1.17.4 windows/amd64


二、🕚 Windows系统上安装Git

参考连接 🔗 Windows系统Git安装教程(详解Git安装过程)


三、💦拷贝 Git 仓库到本地

🎨 打开CMD命令提示符窗口,输入下列命令,下载源码至本地。 🎉

git clone https://github.com/goplus/gop.git
Microsoft Windows [版本 10.0.19042.1237]
(c) Microsoft Corporation。保留所有权利。
C:\Users\xyb\Desktop\Go+>
C:\Users\xyb\Desktop\Go+>git clone https://github.com/goplus/gop.git
Cloning into 'gop'...
remote: Enumerating objects: 16681, done.
remote: Counting objects: 100% (4963/4963), done.
remote: Compressing objects: 100% (1641/1641), done.
remote: Total 16681 (delta 3182), reused 4671 (delta 2987), pack-reused 11718Receiving objects: 100% (16681/16681), 20.1Receiving objects: 100% (16681/16681), 20.65 MiB | 2.33 MiB/s, done.
Resolving deltas: 100% (9704/9704), done.
C:\Users\xyb\Desktop\Go+>


四、💢执行all.bat脚本安装Go+

ac50d929942c4849bbfacb999144c971.png

❌❗若出现下列报错信息,如图所示。

Microsoft Windows [版本 10.0.19042.1237]
(c) Microsoft Corporation。保留所有权利。
C:\Users\xyb\Desktop\Go+\gop\cmd>cd ..
C:\Users\xyb\Desktop\Go+\gop>.\all.bat
C:\Users\xyb\Desktop\Go+\gop>go run cmd/make.go --install --autoproxy
go: github.com/goplus/gox@v1.8.0: Get "https://proxy.golang.org/github.com/goplus/gox/@v/v1.8.0.mod": dial tcp 172.217.160.81:443: connectex: No connection could be made because the target machine actively refused it.
go: github.com/goplus/gox@v1.8.0: Get "https://proxy.golang.org/github.com/goplus/gox/@v/v1.8.0.mod": dial tcp 172.217.160.81:443: connectex: No connection could be made because the target machine actively refused it.
C:\Users\xyb\Desktop\Go+\gop>


则需要设置GOPROXY 环境变量,再执行.\all.bat命令。

C:\Users\xyb\Desktop\Go+\gop>go env -w GOPROXY=https://goproxy.cn,direct
C:\Users\xyb\Desktop\Go+\gop>.\all.bat
C:\Users\xyb\Desktop\Go+\gop>go run cmd/make.go --install --autoproxy
Installing Go+ tools...
go: downloading github.com/qiniu/x v1.11.5
go: downloading github.com/goplus/gox v1.8.0
go: downloading golang.org/x/mod v0.5.1
go: downloading golang.org/x/tools v0.1.7
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
golang.org/x/xerrors/internal
github.com/goplus/gop/token
github.com/goplus/gop/env
github.com/qiniu/x/log
github.com/goplus/gop/scanner
github.com/goplus/gop/x/mod/internal/lazyregexp
github.com/goplus/gop/ast
golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/semver
github.com/goplus/gop/parser
golang.org/x/xerrors
golang.org/x/mod/module
github.com/goplus/gox/internal
github.com/goplus/gop/x/mod/modfile
github.com/goplus/gox/internal/go/printer
golang.org/x/mod/modfile
github.com/goplus/gox/internal/go/format
golang.org/x/sys/execabs
golang.org/x/tools/internal/typeparams
golang.org/x/tools/internal/event/label
golang.org/x/tools/go/internal/gcimporter
golang.org/x/tools/internal/event/keys
golang.org/x/tools/internal/event/core
golang.org/x/tools/internal/event
golang.org/x/tools/internal/gocommand
golang.org/x/tools/go/gcexportdata
golang.org/x/tools/internal/typesinternal
golang.org/x/tools/go/internal/packagesdriver
golang.org/x/tools/internal/packagesinternal
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/go/packages
golang.org/x/tools/go/types/typeutil
github.com/goplus/gop/cmd/internal/search
github.com/goplus/gox
github.com/goplus/gop/x/mod/modfetch
github.com/goplus/gop/printer
github.com/goplus/gop/format
github.com/goplus/gop/x/format
github.com/goplus/gop/cmd/gopfmt
github.com/goplus/gop/cl
github.com/goplus/gop/cmd/goptestgo
github.com/goplus/gop/cmd/gengo
github.com/goplus/gop/x/gopmod
github.com/goplus/gop/cmd/internal/base
github.com/goplus/gop/cmd/internal/modload
github.com/goplus/gop/cmd/internal/clean
github.com/goplus/gop/cmd/internal/env
github.com/goplus/gop/cmd/internal/build
github.com/goplus/gop/cmd/internal/gengo
github.com/goplus/gop/cmd/internal/gopfmt
github.com/goplus/gop/cmd/internal/help
github.com/goplus/gop/cmd/internal/install
github.com/goplus/gop/cmd/internal/mod
github.com/goplus/gop/cmd/internal/run
github.com/goplus/gop/cmd/internal/test
github.com/goplus/gop/cmd/internal/version
github.com/goplus/gop/cmd/goprun
github.com/goplus/gop/cmd/gop
Go+ tools installed successfully!
NEXT STEP:
We just installed Go+ into the directory:  C:\Users\xyb\Desktop\Go+\gop\bin
To setup a better Go+ development environment,
we recommend you add the above install directory into your PATH environment variable.
C:\Users\xyb\Desktop\Go+\gop>cd C:\Users\xyb\Desktop\Go+\gop\bin
C:\Users\xyb\Desktop\Go+\gop\bin>dir
 驱动器 C 中的卷没有标签。
 卷的序列号是 A242-652F
 C:\Users\xyb\Desktop\Go+\gop\bin 的目录
2021/12/06  00:28    <DIR>          .
2021/12/06  00:28    <DIR>          ..
2021/12/06  00:28         9,879,040 gop.exe
2021/12/06  00:28         3,027,968 gopfmt.exe
2021/12/06  00:28         8,086,016 goprun.exe
2021/12/06  00:28         2,599,936 goptestgo.exe
               4 个文件     23,592,960 字节
               2 个目录 28,031,397,888 可用字节
C:\Users\xyb\Desktop\Go+\gop\bin>gop.exe version
gop v1.0.32-61-g15116b6f windows/amd64
C:\Users\xyb\Desktop\Go+\gop\bin>

在Windows系统下,安装Go+编程环境成功。

a1da1617d0c34a528c0efdd580ba8f67.png

查看gop帮助命令 🔍

C:\Users\xyb\Desktop\Go+\gop\bin>gop help
Gop is a tool for managing Go+ source code.
Usage:
        gop <command> [arguments]
The commands are:
        run         Run a Go+ program
        go          Convert Go+ packages into Go packages
        fmt         Format Go+ packages
        mod         module maintenance
        install     Build Go+ files and install target to GOBIN
        build       Build Go+ files
        clean       Clean all Go+ auto generated files
        env         prints Go+ environment information.
        test        Test Go+ packages
        version     Version prints the build information for Gop executables
Use "gop help <command>" for more information about a command.
C:\Users\xyb\Desktop\Go+\gop\bin>


五、✅验证Go+环境是否安装成功

在bin目录下,编写hello.go程序代码 🎨

package main
import "fmt"
func main() {
    fmt.Println([]float64{1, 2, 3.4})
}


执行gop run hello.go运行,结果如下。

6aa95c75efd04abba98c922c43782f0c.png

【本文正在参与“我的Go+语言初体验”征文大赛"活动】活动地址:“我的Go+语言初体验” | 征文活动进行中…

相关文章
|
安全 数据安全/隐私保护 Windows
如何在Windows 10系统中查看已连接WiFi密码-亲测可用-优雅草卓伊凡
如何在Windows 10系统中查看已连接WiFi密码-亲测可用-优雅草卓伊凡
1081 16
如何在Windows 10系统中查看已连接WiFi密码-亲测可用-优雅草卓伊凡
|
关系型数据库 虚拟化 UED
Omnissa Horizon Windows OS Optimization Tool 2503 - Windows 系统映像优化工具
Omnissa Horizon Windows OS Optimization Tool 2503 - Windows 系统映像优化工具
478 7
Omnissa Horizon Windows OS Optimization Tool 2503 - Windows 系统映像优化工具
|
7月前
|
运维 安全 Linux
【清爽加速】Windows 11 Pro 24H2-Emmy精简系统
“清爽加速”Windows 11 Pro 24H2 针对老旧或低配设备,通过精简系统、优化服务与简化装机流程,降低资源占用,提升运行流畅度,兼顾安全性与稳定性,让老设备也能轻松应对日常办公与轻度娱乐需求。
469 1
【清爽加速】Windows 11 Pro 24H2-Emmy精简系统
|
7月前
|
安全 搜索推荐 开发者
【适度精简】Windows 7 旗舰版-emmy精简系统
Windows 7旗舰版因硬件占用高、冗余组件多、兼容性差及缺乏安全更新等问题,逐渐难以满足用户需求。适度精简版通过去除无用组件、优化性能与安全性,提升老旧设备运行效率,增强兼容性与稳定性,同时保留用户熟悉的操作界面,降低学习成本,满足个性化需求,延续Windows 7的实用价值。
360 2
|
7月前
|
安全 数据安全/隐私保护 Windows
ZyperWin++使用教程!让Windows更丝滑!c盘飘红一键搞定!ZyperWin++解决系统优化、Office安装和系统激活
ZyperWin++是一款仅5MB的开源免费Windows优化工具,支持快速优化、自定义设置与垃圾清理,兼具系统加速、隐私保护、Office安装等功能,轻便无广告,小白也能轻松上手,是提升电脑性能的全能管家。
2136 0
|
10月前
|
Ubuntu Linux 数据安全/隐私保护
Windows中安装WSL 2和Ubuntu系统的教程
回看这一路,有趣吧?你已经跨界成为了一个Windows和Linux的桥梁。期待在代码的世界里,把一切玩得风生水起!
538 13
|
8月前
|
Ubuntu Linux Windows
windows11系统安装ubuntu系统详细步骤
安装后,您可以直接从商店启动应用程序来源
1543 0
|
9月前
|
持续交付 Windows
如何使用Sysprep准备Windows系统并使用自动应答
通过Sysprep准备Windows系统,可实现SID重置与系统定制。进入Sysprep后,可安装软件、设置默认桌面文件,并使用Windows SIM创建应答文件以实现自动化部署。适用于系统克隆与批量部署场景。
|
11月前
|
JSON 安全 数据可视化
Elasticsearch(es)在Windows系统上的安装与部署(含Kibana)
Kibana 是 Elastic Stack(原 ELK Stack)中的核心数据可视化工具,主要与 Elasticsearch 配合使用,提供强大的数据探索、分析和展示功能。elasticsearch安装在windows上一般是zip文件,解压到对应目录。文件,elasticsearch8.x以上版本是自动开启安全认证的。kibana安装在windows上一般是zip文件,解压到对应目录。elasticsearch的默认端口是9200,访问。默认用户是elastic,密码需要重置。
5654 0
|
算法 安全 Go
公司局域网管理系统里的 Go 语言 Bloom Filter 算法,太值得深挖了
本文探讨了如何利用 Go 语言中的 Bloom Filter 算法提升公司局域网管理系统的性能。Bloom Filter 是一种高效的空间节省型数据结构,适用于快速判断元素是否存在于集合中。文中通过具体代码示例展示了如何在 Go 中实现 Bloom Filter,并应用于局域网的 IP 访问控制,显著提高系统响应速度和安全性。随着网络规模扩大和技术进步,持续优化算法和结合其他安全技术将是企业维持网络竞争力的关键。
277 2
公司局域网管理系统里的 Go 语言 Bloom Filter 算法,太值得深挖了
下一篇
开通oss服务