Browse Source

mostly logging...

master
Marcell Mars 1 year ago
parent
commit
8a12fbcf83
  1. 10
      README.md
  2. 6
      giq/gogit.go
  3. 3
      go.mod
  4. 11
      go.sum
  5. 64
      main.go
  6. 12
      metahugo.go
  7. BIN
      sphook
  8. 76
      vendor/golang.org/x/mod/module/module.go
  9. 1
      vendor/golang.org/x/sys/cpu/cpu_aix.go
  10. 1
      vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
  11. 1
      vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go
  12. 1
      vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
  13. 1
      vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
  14. 1
      vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go
  15. 1
      vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
  16. 1
      vendor/golang.org/x/sys/cpu/cpu_linux.go
  17. 1
      vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go
  18. 1
      vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
  19. 1
      vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
  20. 1
      vendor/golang.org/x/sys/cpu/cpu_mips64x.go
  21. 1
      vendor/golang.org/x/sys/cpu/cpu_mipsx.go
  22. 1
      vendor/golang.org/x/sys/cpu/cpu_other_arm.go
  23. 4
      vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
  24. 1
      vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go
  25. 1
      vendor/golang.org/x/sys/cpu/cpu_ppc64x.go
  26. 1
      vendor/golang.org/x/sys/cpu/cpu_riscv64.go
  27. 1
      vendor/golang.org/x/sys/cpu/cpu_wasm.go
  28. 1
      vendor/golang.org/x/sys/cpu/cpu_x86.go
  29. 4
      vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go
  30. 4
      vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go
  31. 102
      vendor/golang.org/x/sys/execabs/execabs.go
  32. 3
      vendor/golang.org/x/sys/unix/aliases.go
  33. 10
      vendor/golang.org/x/sys/unix/asm_bsd_386.s
  34. 8
      vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
  35. 8
      vendor/golang.org/x/sys/unix/asm_bsd_arm.s
  36. 8
      vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
  37. 30
      vendor/golang.org/x/sys/unix/asm_darwin_arm.s
  38. 30
      vendor/golang.org/x/sys/unix/asm_darwin_arm64.s
  39. 29
      vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
  40. 29
      vendor/golang.org/x/sys/unix/asm_freebsd_386.s
  41. 29
      vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s
  42. 29
      vendor/golang.org/x/sys/unix/asm_freebsd_arm.s
  43. 29
      vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
  44. 29
      vendor/golang.org/x/sys/unix/asm_netbsd_386.s
  45. 29
      vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s
  46. 29
      vendor/golang.org/x/sys/unix/asm_openbsd_386.s
  47. 29
      vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s
  48. 29
      vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
  49. 29
      vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s
  50. 426
      vendor/golang.org/x/sys/unix/asm_zos_s390x.s
  51. 1
      vendor/golang.org/x/sys/unix/cap_freebsd.go
  52. 3
      vendor/golang.org/x/sys/unix/constants.go
  53. 4
      vendor/golang.org/x/sys/unix/dev_aix_ppc.go
  54. 4
      vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
  55. 29
      vendor/golang.org/x/sys/unix/dev_zos.go
  56. 1
      vendor/golang.org/x/sys/unix/dirent.go
  57. 1
      vendor/golang.org/x/sys/unix/endian_big.go
  58. 1
      vendor/golang.org/x/sys/unix/endian_little.go
  59. 3
      vendor/golang.org/x/sys/unix/env_unix.go
  60. 221
      vendor/golang.org/x/sys/unix/epoll_zos.go
  61. 1
      vendor/golang.org/x/sys/unix/fcntl.go
  62. 1
      vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
  63. 1
      vendor/golang.org/x/sys/unix/fdset.go
  64. 164
      vendor/golang.org/x/sys/unix/fstatfs_zos.go
  65. 4
      vendor/golang.org/x/sys/unix/gccgo.go
  66. 1
      vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
  67. 1
      vendor/golang.org/x/sys/unix/ioctl.go
  68. 74
      vendor/golang.org/x/sys/unix/ioctl_zos.go
  69. 2
      vendor/golang.org/x/sys/unix/mkall.sh
  70. 28
      vendor/golang.org/x/sys/unix/mkerrors.sh
  71. 1
      vendor/golang.org/x/sys/unix/pagesize_unix.go
  72. 1
      vendor/golang.org/x/sys/unix/ptrace_darwin.go
  73. 1
      vendor/golang.org/x/sys/unix/ptrace_ios.go
  74. 1
      vendor/golang.org/x/sys/unix/race.go
  75. 3
      vendor/golang.org/x/sys/unix/race0.go
  76. 1
      vendor/golang.org/x/sys/unix/readdirent_getdents.go
  77. 1
      vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
  78. 3
      vendor/golang.org/x/sys/unix/sockcmsg_unix.go
  79. 7
      vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
  80. 1
      vendor/golang.org/x/sys/unix/str.go
  81. 3
      vendor/golang.org/x/sys/unix/syscall.go
  82. 13
      vendor/golang.org/x/sys/unix/syscall_aix.go
  83. 4
      vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
  84. 4
      vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
  85. 9
      vendor/golang.org/x/sys/unix/syscall_bsd.go
  86. 1
      vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go
  87. 1
      vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
  88. 19
      vendor/golang.org/x/sys/unix/syscall_darwin.go
  89. 1
      vendor/golang.org/x/sys/unix/syscall_darwin_386.go
  90. 1
      vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
  91. 1
      vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
  92. 1
      vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
  93. 18
      vendor/golang.org/x/sys/unix/syscall_dragonfly.go
  94. 1
      vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
  95. 17
      vendor/golang.org/x/sys/unix/syscall_freebsd.go
  96. 1
      vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
  97. 1
      vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
  98. 1
      vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
  99. 1
      vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
  100. 59
      vendor/golang.org/x/sys/unix/syscall_illumos.go
  101. Some files were not shown because too many files have changed in this diff Show More

10
README.md

@ -30,16 +30,6 @@ hook.PublicHTMLPath = filepath.Join("/var", "www", "html", "sandpoints")
change it there and rebuild it.
## Two scenarios: post-commit (local) & post-receive (gitea)
`sphook` should work as it is for two scenarios:
- _bare_ git repository and in our case we run it against the `gitea` instances (git web frontend).
- Gitea keeps its `post-receive` hooks inside the `hooks/post-receive.d/` directory relative to particular _bare_ git repository. `sphook` should land there as it is, no need to change the name, and it will run after every remote `git push` into the repo.
- _working_ git repository
- that's usually a contributor running the local instance of a git repository. In order for `sphinx` to work as `post-commit` hook it should be placed inside `.git/hooks/` directory, renamed to `post-commit` and made executable (`chmod +x post-commit`). Hugo, via that hook, will render its output into:
`/var/www/html/sandpoints/{hugo_project_name}-{`\`crc32.ChecksumIEEE(git_repo_path)\`}`.
## Install `sphook` in Gitea via its web ui
`install_sphook.sh` bash script can be used to install `sphook` to Gitea via its web user interface. If `install_sphook.sh` is made into `post-received` Gitea's hook it will first check if `sphook` is already in `hooks/post-received.d/` directory and if it is not it would install it there. If `sphook` is already there it would delete itself because it is not needed anymore.

6
giq/gogit.go

@ -85,7 +85,7 @@ func isPublish(r gogit.Repository, prevCommit, lastCommit string) bool {
check(err)
hashCommitMap := make(map[string]bool)
err = hashCommitRange.ForEach(func(c *object.Commit) error {
fmt.Println(c.Hash.String(), c.Message)
// fmt.Println(c.Hash.String(), c.Message)
hashCommitMap[c.Hash.String()] = true
ok := strings.Contains(c.Message, "!publish!")
if ok {
@ -117,7 +117,7 @@ func isPublish(r gogit.Repository, prevCommit, lastCommit string) bool {
return nil
})
fmt.Println(hashCommitMap)
// fmt.Println(hashCommitMap)
if ret {
return true
}
@ -134,7 +134,7 @@ func (g *Gogit) AddBareWorktree(gitRepoPath, gitIndexPath, gitWorktree, gexe str
// NoCheckout: true,
})
check(err)
fmt.Println("WORKTREE:", tmpRepoPath)
// fmt.Println("WORKTREE:", tmpRepoPath)
}
func (g *Gogit) RemoveBareWorktree(gitRepoPath, gitIndexPath, gitWorktree, gexe string) {
tmpRepoPath := filepath.Join(os.TempDir(), gitWorktree)

3
go.mod

@ -7,4 +7,7 @@ require (
github.com/go-git/go-git/v5 v5.2.0
github.com/gohugoio/hugo v0.81.0
github.com/spf13/viper v1.7.1
golang.org/x/mod v0.4.2 // indirect
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 // indirect
golang.org/x/tools v0.1.1-0.20210319172145-bda8f5cee399 // indirect
)

11
go.sum

@ -610,8 +610,10 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -717,8 +719,10 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad h1:MCsdmFSdEd4UEa5TKS5JztCRHK/WtvNei1edOj5RSRo=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -783,8 +787,9 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818 h1:u2ssHESKr0HP2d1wlnjMKH+V/22Vg1lGCVuXmOYU1qA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.1-0.20210319172145-bda8f5cee399 h1:O5bm8buX/OaamnfcBrkjn0SPUIU30jFmaS8lP+ikkxs=
golang.org/x/tools v0.1.1-0.20210319172145-bda8f5cee399/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

64
main.go

@ -9,17 +9,19 @@ import (
"path/filepath"
"runtime"
"strings"
"time"
"git.sandpoints.org/Drawwell/SandpointsGitHook/giq"
)
var (
version = "21.03.02"
version = "21.03.04"
logLines = ""
)
func check(e error) {
if e != nil {
fmt.Printf("\nGit hook version: %s\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n", version)
logLines += fmt.Sprintf("\nGit hook version: %s\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n", version)
log.Fatal(e)
panic(e)
}
@ -85,17 +87,10 @@ func hookContext(hook *Hook) {
}
}
func hugoLogs(logLines string, lines []string) string {
logLines = logLines + "~~~~~~~~~~ Hugo's logs ~~~~~~~~~~\n"
for _, d := range lines {
logLines = logLines + d + "\n"
}
logLines = logLines + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
return logLines
}
func main() {
startTime := time.Now()
logLines := "~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n" + startTime.Format(time.RFC822) + "\n"
// init global struct/variables
var hook *Hook
var hugo *Hugo
@ -109,24 +104,22 @@ func main() {
hook.Gogit = true
hook.PublicHTMLPath = filepath.Join("/var", "www", "html", "sandpoints")
logLines := ""
// hookExe, err := os.Executable()
// check(err)
// hook.ExecutablePath = filepath.Dir(hookExe)
hook.ExecutablePath = "/home/m/Downloads/SimpleSandpoints/.git/hooks"
// hook.ExecutablePath = "/home/m/Downloads/SimpleSandpoints/.git/hooks"
// hook.ExecutablePath = "/home/m/gitea-repositories/sandpoints/dev.git/hooks/post-receive.d"
hook.ExecutablePath = "/home/m/gitea-repositories/sandpoints/simplesandpoints.git/hooks/post-receive.d"
hookContext(hook)
gitPath := gitExePath(hook)
giqi = &giq.Gogit{}
// enforce go-git if mocking hook.ExecutablePath
if hook.Gogit {
// DEFAULT but enforce sysgit if mocking hook.ExecutablePath
// if !hook.Gogit {
// if hook.Gogit {
// DEFAULT but enforce sysgit if mocking hook.ExecutablePath
if !hook.Gogit {
giqi = &giq.Sysgit{}
}
fmt.Println(giqi.Whoami())
git = giqi.GitStruct(hook.ExecutablePath, hook.Context, hook.Stdinput, gitPath)
fmt.Printf("%#v\n", git)
hook.Publish = git.Publish
hugo.SourceDir = git.RepoPath
// hugo.DestinationDir =
@ -136,18 +129,31 @@ func main() {
defer giqi.RemoveBareWorktree(git.RepoPath, git.IndexPath, git.Worktree, gitPath)
hugo.SourceDir = git.TmpRepoPath
tree, err := exec.Command("/usr/bin/tree", git.TmpRepoPath).Output()
check(err)
fmt.Println(string(tree))
// tree, err := exec.Command("/usr/bin/tree", git.TmpRepoPath).Output()
// check(err)
// fmt.Println(string(tree))
}
hugoContext(hugo, git.RepoPath)
fmt.Printf("%#v\n", hugo)
hugoRender(hugo, hook.Offline)
cleanUpPublicHTML(hugo, hook)
copyToPublicHTML(hugo, hook)
_ = hugo
_ = logLines
logs := hugoRender(hugo, hook.Offline)
// fmt.Println(logs)
logLines += fmt.Sprintf(logs)
if git.IsBare {
cleanUpPublicHTML(hugo, hook)
copyToPublicHTML(hugo, hook)
if hook.Publish {
// fmt.Println("Web site:", filepath.Join(hook.PublicHTMLPath, hugo.PublicHTMLName))
logLines += fmt.Sprintf("Web site: %s\n", filepath.Join(hook.PublicHTMLPath, hugo.PublicHTMLName))
} else {
// fmt.Println("Web site:", filepath.Join(hook.PublicHTMLPath, hugo.PublicHTMLName, "_preview"))
logLines += fmt.Sprintf("Web site: %s\n", filepath.Join(hook.PublicHTMLPath, hugo.PublicHTMLName, "_preview"))
}
} else {
// fmt.Println("Web site:", hugo.DestinationDir)
logLines += fmt.Sprintf("Web site: %s\n", hugo.DestinationDir)
}
durationMillseconds := int64(time.Since(startTime) / time.Millisecond)
logLines = logLines + fmt.Sprintf("Total processing time: %d ms\n\nGit hook version: %s\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n", durationMillseconds, version)
fmt.Println(logLines)
}

12
metahugo.go

@ -1,7 +1,6 @@
package main
import (
"fmt"
"hash/crc32"
"path/filepath"
"regexp"
@ -30,8 +29,8 @@ func hugoContext(hugo *Hugo, gitRepoPath string) {
hugo.DestinationDir = filepath.Join(hugo.SourceDir, "public")
}
func hugoRender(hugo *Hugo, hookOffline bool) {
fmt.Println("hugo", "-s", hugo.SourceDir, "-d", hugo.DestinationDir, "--templateMetrics")
func hugoRender(hugo *Hugo, hookOffline bool) string {
// fmt.Println("hugo", "-s", hugo.SourceDir, "-d", hugo.DestinationDir, "--templateMetrics")
logs := cage.Start()
hugoCommand := []string{"-s", hugo.SourceDir, "-d", hugo.DestinationDir, "--templateMetrics"}
if hookOffline {
@ -40,7 +39,12 @@ func hugoRender(hugo *Hugo, hookOffline bool) {
goHugo := commands.Execute(hugoCommand)
cage.Stop(logs)
if goHugo.Err != nil {
fmt.Sprintf("Hugo's attempt to render the web site ended up with an Error! Check out the last commit to capture possible errors.\n\n%s\n~~~~~~~~~~\n\n%s", goHugo.Err)
check(goHugo.Err)
runtime.Goexit()
}
lgs := "~~~~~~~ Hugo's logs ~~~~~~~\n"
for _, l := range logs.Data {
lgs = lgs + l + "\n"
}
return lgs
}

BIN
sphook

Binary file not shown.

76
vendor/golang.org/x/mod/module/module.go generated vendored

@ -224,12 +224,16 @@ func firstPathOK(r rune) bool {
'a' <= r && r <= 'z'
}
// pathOK reports whether r can appear in an import path element.
// modPathOK reports whether r can appear in a module path element.
// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~.
// This matches what "go get" has historically recognized in import paths.
//
// This matches what "go get" has historically recognized in import paths,
// and avoids confusing sequences like '%20' or '+' that would change meaning
// if used in a URL.
//
// TODO(rsc): We would like to allow Unicode letters, but that requires additional
// care in the safe encoding (see "escaped paths" above).
func pathOK(r rune) bool {
func modPathOK(r rune) bool {
if r < utf8.RuneSelf {
return r == '-' || r == '.' || r == '_' || r == '~' ||
'0' <= r && r <= '9' ||
@ -239,6 +243,17 @@ func pathOK(r rune) bool {
return false
}
// modPathOK reports whether r can appear in a package import path element.
//
// Import paths are intermediate between module paths and file paths: we allow
// disallow characters that would be confusing or ambiguous as arguments to
// 'go get' (such as '@' and ' ' ), but allow certain characters that are
// otherwise-unambiguous on the command line and historically used for some
// binary names (such as '++' as a suffix for compiler binaries and wrappers).
func importPathOK(r rune) bool {
return modPathOK(r) || r == '+'
}
// fileNameOK reports whether r can appear in a file name.
// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters.
// If we expand the set of allowed characters here, we have to
@ -270,7 +285,7 @@ func fileNameOK(r rune) bool {
// CheckPath checks that a module path is valid.
// A valid module path is a valid import path, as checked by CheckImportPath,
// with two additional constraints.
// with three additional constraints.
// First, the leading path element (up to the first slash, if any),
// by convention a domain name, must contain only lower-case ASCII letters,
// ASCII digits, dots (U+002E), and dashes (U+002D);
@ -280,8 +295,9 @@ func fileNameOK(r rune) bool {
// and must not contain any dots. For paths beginning with "gopkg.in/",
// this second requirement is replaced by a requirement that the path
// follow the gopkg.in server's conventions.
// Third, no path element may begin with a dot.
func CheckPath(path string) error {
if err := checkPath(path, false); err != nil {
if err := checkPath(path, modulePath); err != nil {
return fmt.Errorf("malformed module path %q: %v", path, err)
}
i := strings.Index(path, "/")
@ -315,7 +331,7 @@ func CheckPath(path string) error {
//
// A valid path element is a non-empty string made up of
// ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~.
// It must not begin or end with a dot (U+002E), nor contain two dots in a row.
// It must not end with a dot (U+002E), nor contain two dots in a row.
//
// The element prefix up to the first dot must not be a reserved file name
// on Windows, regardless of case (CON, com1, NuL, and so on). The element
@ -326,19 +342,29 @@ func CheckPath(path string) error {
// top-level package documentation for additional information about
// subtleties of Unicode.
func CheckImportPath(path string) error {
if err := checkPath(path, false); err != nil {
if err := checkPath(path, importPath); err != nil {
return fmt.Errorf("malformed import path %q: %v", path, err)
}
return nil
}
// pathKind indicates what kind of path we're checking. Module paths,
// import paths, and file paths have different restrictions.
type pathKind int
const (
modulePath pathKind = iota
importPath
filePath
)
// checkPath checks that a general path is valid.
// It returns an error describing why but not mentioning path.
// Because these checks apply to both module paths and import paths,
// the caller is expected to add the "malformed ___ path %q: " prefix.
// fileName indicates whether the final element of the path is a file name
// (as opposed to a directory name).
func checkPath(path string, fileName bool) error {
func checkPath(path string, kind pathKind) error {
if !utf8.ValidString(path) {
return fmt.Errorf("invalid UTF-8")
}
@ -357,39 +383,45 @@ func checkPath(path string, fileName bool) error {
elemStart := 0
for i, r := range path {
if r == '/' {
if err := checkElem(path[elemStart:i], fileName); err != nil {
if err := checkElem(path[elemStart:i], kind); err != nil {
return err
}
elemStart = i + 1
}
}
if err := checkElem(path[elemStart:], fileName); err != nil {
if err := checkElem(path[elemStart:], kind); err != nil {
return err
}
return nil
}
// checkElem checks whether an individual path element is valid.
// fileName indicates whether the element is a file name (not a directory name).
func checkElem(elem string, fileName bool) error {
func checkElem(elem string, kind pathKind) error {
if elem == "" {
return fmt.Errorf("empty path element")
}
if strings.Count(elem, ".") == len(elem) {
return fmt.Errorf("invalid path element %q", elem)
}
if elem[0] == '.' && !fileName {
if elem[0] == '.' && kind == modulePath {
return fmt.Errorf("leading dot in path element")
}
if elem[len(elem)-1] == '.' {
return fmt.Errorf("trailing dot in path element")
}
charOK := pathOK
if fileName {
charOK = fileNameOK
}
for _, r := range elem {
if !charOK(r) {
ok := false
switch kind {
case modulePath:
ok = modPathOK(r)
case importPath:
ok = importPathOK(r)
case filePath:
ok = fileNameOK(r)
default:
panic(fmt.Sprintf("internal error: invalid kind %v", kind))
}
if !ok {
return fmt.Errorf("invalid char %q", r)
}
}
@ -406,7 +438,7 @@ func checkElem(elem string, fileName bool) error {
}
}
if fileName {
if kind == filePath {
// don't check for Windows short-names in file names. They're
// only an issue for import paths.
return nil
@ -444,7 +476,7 @@ func checkElem(elem string, fileName bool) error {
// top-level package documentation for additional information about
// subtleties of Unicode.
func CheckFilePath(path string) error {
if err := checkPath(path, true); err != nil {
if err := checkPath(path, filePath); err != nil {
return fmt.Errorf("malformed file path %q: %v", path, err)
}
return nil
@ -647,7 +679,7 @@ func EscapePath(path string) (escaped string, err error) {
// Versions are allowed to be in non-semver form but must be valid file names
// and not contain exclamation marks.
func EscapeVersion(v string) (escaped string, err error) {
if err := checkElem(v, true); err != nil || strings.Contains(v, "!") {
if err := checkElem(v, filePath); err != nil || strings.Contains(v, "!") {
return "", &InvalidVersionError{
Version: v,
Err: fmt.Errorf("disallowed version string"),
@ -706,7 +738,7 @@ func UnescapeVersion(escaped string) (v string, err error) {
if !ok {
return "", fmt.Errorf("invalid escaped version %q", escaped)
}
if err := checkElem(v, true); err != nil {
if err := checkElem(v, filePath); err != nil {
return "", fmt.Errorf("invalid escaped version %q: %v", v, err)
}
return v, nil

1
vendor/golang.org/x/sys/cpu/cpu_aix.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build aix
// +build aix
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc
// +build gc
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc
// +build gc
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_gc_x86.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (386 || amd64 || amd64p32) && gc
// +build 386 amd64 amd64p32
// +build gc

1
vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gccgo
// +build gccgo
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gccgo
// +build gccgo
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (386 || amd64 || amd64p32) && gccgo
// +build 386 amd64 amd64p32
// +build gccgo

1
vendor/golang.org/x/sys/cpu/cpu_linux.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !386 && !amd64 && !amd64p32 && !arm64
// +build !386,!amd64,!amd64p32,!arm64
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux && (mips64 || mips64le)
// +build linux
// +build mips64 mips64le

1
vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
// +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux && (ppc64 || ppc64le)
// +build linux
// +build ppc64 ppc64le

1
vendor/golang.org/x/sys/cpu/cpu_mips64x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build mips64 || mips64le
// +build mips64 mips64le
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_mipsx.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build mips || mipsle
// +build mips mipsle
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_other_arm.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !linux && arm
// +build !linux,arm
package cpu

4
vendor/golang.org/x/sys/cpu/cpu_other_arm64.go generated vendored

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !linux,!netbsd
// +build arm64
//go:build !linux && !netbsd && arm64
// +build !linux,!netbsd,arm64
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !linux && (mips64 || mips64le)
// +build !linux
// +build mips64 mips64le

1
vendor/golang.org/x/sys/cpu/cpu_ppc64x.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ppc64 || ppc64le
// +build ppc64 ppc64le
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_riscv64.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build riscv64
// +build riscv64
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_wasm.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build wasm
// +build wasm
package cpu

1
vendor/golang.org/x/sys/cpu/cpu_x86.go generated vendored

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build 386 || amd64 || amd64p32
// +build 386 amd64 amd64p32
package cpu

4
vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go generated vendored

@ -8,8 +8,8 @@
// Morever, this file will be used during the building of
// gccgo's libgo and thus must not used a CGo method.
// +build aix
// +build gccgo
//go:build aix && gccgo
// +build aix,gccgo
package cpu

4
vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go generated vendored

@ -6,8 +6,8 @@
// system call on AIX without depending on x/sys/unix.
// (See golang.org/issue/32102)
// +build aix,ppc64
// +build gc
//go:build aix && ppc64 && gc
// +build aix,ppc64,gc
package cpu

102
vendor/golang.org/x/sys/execabs/execabs.go generated vendored

@ -0,0 +1,102 @@
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package execabs is a drop-in replacement for os/exec
// that requires PATH lookups to find absolute paths.
// That is, execabs.Command("cmd") runs the same PATH lookup
// as exec.Command("cmd"), but if the result is a path
// which is relative, the Run and Start methods will report
// an error instead of running the executable.
//
// See https://blog.golang.org/path-security for more information
// about when it may be necessary or appropriate to use this package.
package execabs
import (
"context"
"fmt"
"os/exec"
"path/filepath"
"reflect"
"unsafe"
)
// ErrNotFound is the error resulting if a path search failed to find an executable file.
// It is an alias for exec.ErrNotFound.
var ErrNotFound = exec.ErrNotFound
// Cmd represents an external command being prepared or run.
// It is an alias for exec.Cmd.
type Cmd = exec.Cmd
// Error is returned by LookPath when it fails to classify a file as an executable.
// It is an alias for exec.Error.
type Error = exec.Error
// An ExitError reports an unsuccessful exit by a command.
// It is an alias for exec.ExitError.
type ExitError = exec.ExitError
func relError(file, path string) error {
return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path)
}
// LookPath searches for an executable named file in the directories
// named by the PATH environment variable. If file contains a slash,
// it is tried directly and the PATH is not consulted. The result will be
// an absolute path.
//
// LookPath differs from exec.LookPath in its handling of PATH lookups,
// which are used for file names without slashes. If exec.LookPath's
// PATH lookup would have returned an executable from the current directory,
// LookPath instead returns an error.
func LookPath(file string) (string, error) {
path, err := exec.LookPath(file)
if err != nil {
return "", err
}
if filepath.Base(file) == file && !filepath.IsAbs(path) {
return "", relError(file, path)
}
return path, nil
}
func fixCmd(name string, cmd *exec.Cmd) {
if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) {
// exec.Command was called with a bare binary name and
// exec.LookPath returned a path which is not absolute.
// Set cmd.lookPathErr and clear cmd.Path so that it
// cannot be run.
lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer()))
if *lookPathErr == nil {
*lookPathErr = relError(name, cmd.Path)
}
cmd.Path = ""
}
}
// CommandContext is like Command but includes a context.
//
// The provided context is used to kill the process (by calling os.Process.Kill)
// if the context becomes done before the command completes on its own.
func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd {
cmd := exec.CommandContext(ctx, name, arg...)
fixCmd(name, cmd)
return cmd
}
// Command returns the Cmd struct to execute the named program with the given arguments.
// See exec.Command for most details.
//
// Command differs from exec.Command in its handling of PATH lookups,
// which are used when the program name contains no slashes.
// If exec.Command would have returned an exec.Cmd configured to run an
// executable from the current directory, Command instead
// returns an exec.Cmd that will return an error from Start or Run.
func Command(name string, arg ...string) *exec.Cmd {
cmd := exec.Command(name, arg...)
fixCmd(name, cmd)
return cmd
}

3
vendor/golang.org/x/sys/unix/aliases.go generated vendored

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
// +build go1.9
package unix

10
vendor/golang.org/x/sys/unix/asm_darwin_386.s → vendor/golang.org/x/sys/unix/asm_bsd_386.s generated vendored

@ -1,14 +1,14 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (darwin || freebsd || netbsd || openbsd) && gc
// +build darwin freebsd netbsd openbsd
// +build gc
#include "textflag.h"
//
// System call support for 386, Darwin
//
// System call support for 386 BSD
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
@ -22,7 +22,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-40
TEXT ·Syscall9(SB),NOSPLIT,$0-52
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40

8
vendor/golang.org/x/sys/unix/asm_darwin_amd64.s → vendor/golang.org/x/sys/unix/asm_bsd_amd64.s generated vendored

@ -1,14 +1,14 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
// +build darwin dragonfly freebsd netbsd openbsd
// +build gc
#include "textflag.h"
//
// System call support for AMD64, Darwin
//
// System call support for AMD64 BSD
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.

8
vendor/golang.org/x/sys/unix/asm_netbsd_arm.s → vendor/golang.org/x/sys/unix/asm_bsd_arm.s generated vendored

@ -1,14 +1,14 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (darwin || freebsd || netbsd || openbsd) && gc
// +build darwin freebsd netbsd openbsd
// +build gc
#include "textflag.h"
//
// System call support for ARM, NetBSD
//
// System call support for ARM BSD
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.

8
vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s → vendor/golang.org/x/sys/unix/asm_bsd_arm64.s generated vendored

@ -1,14 +1,14 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (darwin || freebsd || netbsd || openbsd) && gc
// +build darwin freebsd netbsd openbsd
// +build gc
#include "textflag.h"
//
// System call support for AMD64, NetBSD
//
// System call support for ARM64 BSD
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.

30
vendor/golang.org/x/sys/unix/asm_darwin_arm.s generated vendored

@ -1,30 +0,0 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
// +build arm,darwin
#include "textflag.h"
//
// System call support for ARM, Darwin
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-28
B syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-40
B syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-52
B syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
B syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
B syscall·RawSyscall6(SB)

30
vendor/golang.org/x/sys/unix/asm_darwin_arm64.s generated vendored

@ -1,30 +0,0 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
// +build arm64,darwin
#include "textflag.h"
//
// System call support for AMD64, Darwin
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
B syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
B syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
B syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
B syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
B syscall·RawSyscall6(SB)

29
vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s generated vendored

@ -1,29 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
#include "textflag.h"
//
// System call support for AMD64, DragonFly
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
JMP syscall·RawSyscall6(SB)

29
vendor/golang.org/x/sys/unix/asm_freebsd_386.s generated vendored

@ -1,29 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
#include "textflag.h"
//
// System call support for 386, FreeBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-28
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-40
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-52
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
JMP syscall·RawSyscall6(SB)

29
vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s generated vendored

@ -1,29 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
#include "textflag.h"
//
// System call support for AMD64, FreeBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
JMP syscall·RawSyscall6(SB)

29
vendor/golang.org/x/sys/unix/asm_freebsd_arm.s generated vendored

@ -1,29 +0,0 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
#include "textflag.h"
//
// System call support for ARM, FreeBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-28
B syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-40
B syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-52
B syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
B syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
B syscall·RawSyscall6(SB)

29
vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s generated vendored

@ -1,29 +0,0 @@
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gc
#include "textflag.h"
//
// System call support for ARM64, FreeBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,