All of the following information is based on go version go1.17.1 darwin/amd64.
| GOOS | Out of the Box |
|---|---|
aix |
✅ |
android |
✅ |
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.
At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
| #!/bin/bash | |
| # Thanks goes to @pete-otaqui for the initial gist: | |
| # https://gist.github.com/pete-otaqui/4188238 | |
| # | |
| # Original version modified by Marek Suscak | |
| # | |
| # works with a file called VERSION in the current directory, | |
| # the contents of which should be a semantic version number | |
| # such as "1.2.3" or even "1.2.3-beta+001.ab" |
| package main | |
| import ( | |
| "archive/tar" | |
| "compress/gzip" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "os" | |
| ) |
| # Kernel sysctl configuration file for Red Hat Linux | |
| # | |
| # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
| # sysctl.conf(5) for more details. | |
| # Turn on execshield | |
| # 0 completely disables ExecShield and Address Space Layout Randomization | |
| # 1 enables them ONLY if the application bits for these protections are set to “enable” | |
| # 2 enables them by default, except if the application bits are set to “disable” | |
| # 3 enables them always, whatever the application bits |
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Foo struct { | |
| FirstName string `tag_name:"tag 1"` | |
| LastName string `tag_name:"tag 2"` |
| getCIK = function(ticker) { | |
| stopifnot(is.character(ticker)) | |
| uri = "http://www.sec.gov/cgi-bin/browse-edgar" | |
| response = getForm(uri,CIK=ticker,action="getcompany") | |
| html = htmlParse(response) | |
| CIKNode = getNodeSet(html, "//acronym[@title=\"Central Index Key\"][text() = \"CIK\"]") | |
| CIKNodeText = sapply(CIKNode, function(x) xmlValue(getSibling(getSibling(x)))) | |
| CIK = sub(" .*","",CIKNodeText) | |
| CIK = sub("^0*","",CIK) |