Open mtchuyen opened 3 years ago
$> glide cc
$> glide up
go: github.com/Sirupsen/logrus@v1.5.0: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus
Solution:
replace github.com/Sirupsen/logrus v1.5.0 => github.com/sirupsen/logrus v1.5.0
v1.5.0
https://rashadansari.medium.com/working-with-go-sub-module-as-a-library-93e5db59a0f2
Gặp lỗi: artifacts not found
Uploading artifacts...
WARNING: /build/Project*.zip: no matching files
The path of artifacts has to be relative to and be a child of $CI_PROJECT_DIR.
- echo $CI_PROJECT_DIR
- ls -la $CI_PROJECT_DIR
- mkdir -pv $CI_PROJECT_DIR/binary
- cp <<binary_file_after_compile>> $CI_PROJECT_DIR/binary/
- ls -la $CI_PROJECT_DIR/
- ls -la $CI_PROJECT_DIR/binary
artifacts:
name: binary-<<binary_file_after_compile>>
paths:
- binary/<<binary_file_after_compile>>
expire_in: 1 week
Gặp lỗi: artifacts not found
Uploading artifacts...
WARNING: /build/Project*.zip: no matching files
The path of artifacts has to be relative to and be a child of $CI_PROJECT_DIR.
script:
- echo $CI_PROJECT_DIR
- ls -la $CI_PROJECT_DIR
- mkdir -pv $CI_PROJECT_DIR/binary
- cp <<binary_file_after_compile>> $CI_PROJECT_DIR/binary/
- ls -la $CI_PROJECT_DIR/
- ls -la $CI_PROJECT_DIR/binary
artifacts:
name: binary-<<binary_file_after_compile>>
paths:
- binary/<<binary_file_after_compile>>
expire_in: 1 week
When working with the Go programming language, developers often come across two important commands: go get and go install. While both commands are related to managing dependencies and building packages, they have distinct purposes. In this article, we will explore the differences between these two commands and understand when to use each of them.
Fetching and Updating Remote Packages. The go get
command is primarily used for retrieving remote packages from version control repositories and making them available for use in your projects.
When you run go get, Go downloads the source code of the package and its dependencies within your workspace's
bin and pkg
directories.
Additionally, go get
can also update packages to their latest versions if you have already installed them.
The go install
command operates on the local codebase residing in your development environment. It compiles and installs the package present in your local code repository (typically in the GOPATH). If the package has not been fetched yet or if there are updates available, go install will fetch the necessary remote packages and their dependencies, compile them, and install the resulting binaries in the appropriate location within your workspace's bin directory. Therefore, go install can fetch remote packages if required.
For installing executables, go get is deprecated since go 1.17 and go install is the only viable option to acquire executables.
Check Go Env
cmd: go env
Find:
Setup repo private
or
Gặp các thư viện quá cũ, không con
open
trên repo (gitlab,...) thì sử dụng env:Step 1:
or