Compile and install packages in Go locally in Go: Go install UC, which will copy uc.a to e:\wwwroot\go\pkg\windows_amd64
1. Reference URL:https://www.shuijingwanwq.com/2020/07/02/4288/. Previously, the code file could only be placed below: C:\Users\Administrator\Go\Src. Put it in: E:\wwwroot\go\src will report an error.
2. Edit the environment variable – the user variable of Administrator – GOPATH, its original value is: C:\Users\Administrator\Go, create a new: E:\wwwroot\go. Its new value is: C:\Users\Administrator\Go;E:\wwwroot\go. as shown in Figure 1
3. Reference URL:https://github.com/unknwon/the-way-to-go_ZH_CN/blob/master/eBook/09.8.md. Compile and install the package to the local: go install uc, which will copy uc.a to e:\wwwroot\go\pkg\windows_amd64. as shown in Figure 2
PS E:\wwwroot\go\src> cd uc
PS E:\wwwroot\go\src\uc> ls
目录: E:\wwwroot\go\src\uc
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2020/07/30 19:01 96 Makefile
-a---- 2020/07/27 20:25 100 uc.go
-a---- 2020/07/27 20:30 380 uc_test.go
PS E:\wwwroot\go\src\uc> cd ..
PS E:\wwwroot\go\src> go install uc
PS E:\wwwroot\go\src> cd ..
PS E:\wwwroot\go> cd .\pkg\
PS E:\wwwroot\go\pkg> ls
目录: E:\wwwroot\go\pkg
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2020/08/04 19:25 windows_amd64
PS E:\wwwroot\go\pkg> cd .\windows_amd64\
PS E:\wwwroot\go\pkg\windows_amd64> ls
目录: E:\wwwroot\go\pkg\windows_amd64
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2020/08/04 19:36 1568 uc.a

