awdb-golang

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

awdb-golang

www.ipplus360.com

官方支持的解析awdb格式的Golang代码(Official support for parsing Golang code in AWDB format )

GO版本建议

建议的GO版本为1.14.4,支持的GO版本为1.11.1以上
示例:Centos7安装go1.14.4
1. 命令安装:
wget https://golang.google.cn/dl/go1.14.4.linux-amd64.tar.gz
2. 解压go包到/usr/local
tar -zxf go1.14.4.linux-amd64.tar.gz -C /usr/local
3. 配置环境变量,vim指令编辑 /etc/profile
vim /etc/profile
4. 在/etc/profile文件末尾添加以下配置
#golang config
export GO111MODULE=auto
export GOROOT=/usr/local/go
export GOPATH=/home/用户名/gopath #或其他位置
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
5. 将变量配置生效,并查看golang的版本
source /etc/profile          ==========使换将变量配置生效    
go version                   ==========查看golang的版本
go version go1.14.4 linux/amd64        --打印输出
6. 设置代理环境变量,再拉去golang.org的时候就不需要墙了。注意GO1.13及之后支持direct的写法
go env -w GOPROXY=https://goproxy.cn,direct
7. 安装完毕写一个helloworld测试

切换到home目录,创建一个hello.go,创建一个gopath

mkdir gopath
vim hello.go
8. 复制粘贴helloworld代码,i插入, :wq保存即可
package main  
import "fmt"  
func main() {  
fmt.Printf("Hello, world!\n")  
}  
9. 运行代码
go run hello.go
Hello, world!          --输出
注意:使用非go mod编译版本代码需要导入下列依赖包放入指定位置

依赖包

https://github.com/golang/sys.git   
这是最新版本的git

使用GO 1.14.4版本,需要下载对应版本的依赖包
注意:使用其他版本需要查看下面链接下的相关分支,下载对应go版本的依赖包,步骤相同

https://github.com/golang/sys/tree/release-branch.go1.14-cmd 
或
https://gitee.com/golang-x/sys/tree/release-branch.go1.14-cmd
1. 下载该依赖包
cd ~
wget https://github.com/golang/sys/archive/refs/heads/release-branch.go1.14-cmd.zip 
2. 解压
unzip release-branch.go1.14-cmd.zip
3. 放到gopath目录,目录下需要创建文件夹,$GOPATH/src/golang.org/x/sys
mkdir -p $GOPATH/src/golang.org/x/sys
cd sys-release-branch.go1.14-cmd
mv ./* $GOPATH/src/golang.org/x/sys

运行命令

go run example.go

或者

go build example.go
./example

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL