8 Commits

100 changed files with 667 additions and 1397 deletions
Split View
  1. +7
    -0
      arm.sh
  2. +3
    -1
      go.mod
  3. +8
    -2
      go.sum
  4. +1
    -1
      index.html
  5. +8
    -8
      models/oauth2.go
  6. +4
    -5
      modules/auth/oauth2/oauth2.go
  7. +2
    -2
      modules/setting/setting.go
  8. +6
    -6
      modules/storage/storage.go
  9. BIN
      public/img/auth/openi.png
  10. BIN
      public/img/gitlogo.png
  11. +37
    -39
      services/ai_task_service/task/task_service.go
  12. +2
    -2
      templates/base/head_navbar_fluid.tmpl
  13. +1
    -1
      templates/base/head_navbar_pro.tmpl
  14. +3
    -0
      templates/custom/extra_links.tmpl
  15. +1
    -29
      templates/user/auth/signin_inner.tmpl
  16. +3
    -3
      vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go
  17. +2
    -2
      vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go
  18. +1
    -1
      vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go
  19. +2
    -2
      vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go
  20. +4
    -4
      vendor/github.com/go-git/go-billy/v5/util/walk.go
  21. +6
    -1
      vendor/github.com/golang/snappy/README
  22. +2
    -2
      vendor/github.com/golang/snappy/encode_arm64.s
  23. +1
    -1
      vendor/github.com/imdario/mergo/.deepsource.toml
  24. +6
    -70
      vendor/github.com/stretchr/testify/assert/assertion_compare.go
  25. +0
    -16
      vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go
  26. +0
    -16
      vendor/github.com/stretchr/testify/assert/assertion_compare_legacy.go
  27. +0
    -22
      vendor/github.com/stretchr/testify/assert/assertion_format.go
  28. +0
    -44
      vendor/github.com/stretchr/testify/assert/assertion_forward.go
  29. +4
    -4
      vendor/github.com/stretchr/testify/assert/assertion_order.go
  30. +48
    -142
      vendor/github.com/stretchr/testify/assert/assertions.go
  31. +0
    -56
      vendor/github.com/stretchr/testify/require/require.go
  32. +0
    -44
      vendor/github.com/stretchr/testify/require/require_forward.go
  33. +0
    -0
      vendor/golang.org/x/crypto/ed25519/ed25519.go
  34. +3
    -0
      vendor/golang.org/x/image/AUTHORS
  35. +3
    -0
      vendor/golang.org/x/image/CONTRIBUTORS
  36. +0
    -6
      vendor/golang.org/x/image/bmp/reader.go
  37. +29
    -127
      vendor/golang.org/x/image/ccitt/reader.go
  38. +467
    -450
      vendor/golang.org/x/image/ccitt/table.go
  39. +0
    -1
      vendor/golang.org/x/image/tiff/fuzz.go
  40. +3
    -3
      vendor/golang.org/x/image/tiff/lzw/reader.go
  41. +0
    -3
      vendor/golang.org/x/image/tiff/reader.go
  42. +0
    -3
      vendor/golang.org/x/image/tiff/writer.go
  43. +0
    -1
      vendor/golang.org/x/mod/module/module.go
  44. +0
    -0
      vendor/golang.org/x/net/http2/server.go
  45. +0
    -0
      vendor/golang.org/x/net/http2/transport.go
  46. +0
    -0
      vendor/golang.org/x/net/idna/idna9.0.0.go
  47. +0
    -0
      vendor/golang.org/x/sys/unix/mkerrors.sh
  48. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_darwin.go
  49. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_freebsd.go
  50. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
  51. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
  52. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
  53. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
  54. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_illumos.go
  55. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_linux.go
  56. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_linux_386.go
  57. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_linux_arm.go
  58. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
  59. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
  60. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
  61. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_netbsd.go
  62. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_openbsd.go
  63. +0
    -277
      vendor/golang.org/x/sys/unix/syscall_solaris.go
  64. +0
    -0
      vendor/golang.org/x/sys/unix/syscall_unix.go
  65. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
  66. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
  67. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux.go
  68. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_386.go
  69. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
  70. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
  71. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
  72. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
  73. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
  74. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
  75. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
  76. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
  77. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
  78. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
  79. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
  80. +0
    -0
      vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
  81. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go
  82. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_linux.go
  83. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
  84. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
  85. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
  86. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
  87. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
  88. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
  89. +0
    -0
      vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
  90. +0
    -0
      vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
  91. +0
    -0
      vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
  92. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
  93. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux.go
  94. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_386.go
  95. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
  96. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
  97. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
  98. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
  99. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
  100. +0
    -0
      vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go

+ 7
- 0
arm.sh View File

@@ -0,0 +1,7 @@
LDFLAGS= GOOS=linux GOARCH=arm64 NODE_OPTIONS=--openssl-legacy-provider TAGS="bindata" make build

sshpass -pCloudbrain2@pcl scp -o StrictHostKeyChecking=no /Users/ww/IdeaProjects/aiforge/opendata root@10.16.22.25:/data/

sshpass -pCloudbrain2@pcl ssh -o StrictHostKeyChecking=no root@10.16.22.25 'mv /data/opendata /data/pengcheng/aiforge/opendata'

sshpass -pCloudbrain2@pcl ssh -o StrictHostKeyChecking=no root@10.16.22.23 'Edu delete aiforge'

+ 3
- 1
go.mod View File

@@ -3,6 +3,7 @@ module code.gitea.io/gitea
go 1.18

require (
baliance.com/gooxml v1.0.1
gitea.com/jolheiser/gitea-vet v0.1.0
gitea.com/lunny/levelqueue v0.3.0
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b
@@ -29,6 +30,7 @@ require (
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/disintegration/imaging v1.6.2
github.com/drone/drone-go v1.7.1
github.com/dustin/go-humanize v1.0.0
github.com/editorconfig/editorconfig-core-go/v2 v2.1.1
github.com/elliotchance/orderedmap v1.4.0
@@ -179,7 +181,7 @@ require (
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/gorilla/css v1.0.0 // indirect


+ 8
- 2
go.sum View File

@@ -1,3 +1,5 @@
baliance.com/gooxml v1.0.1 h1:fG5lmxmjEVFfbKQ2NuyCuU3hMuuOb5avh5a38SZNO1o=
baliance.com/gooxml v1.0.1/go.mod h1:+gpUgmkAF4zCtwOFPNRLDAvpVRWoKs5EeQTSv/HYFnw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.30.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
@@ -15,7 +17,7 @@ dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
git.apache.org/thrift.git v0.0.0-20180902110e319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.0.0-20181218151757-9b75e4fe745a/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
gitea.com/jolheiser/gitea-vet v0.1.0 h1:gJEms9YWbIcrPOEmDOJ+5JZXCYFxNpwxlI73uRulAi4=
gitea.com/jolheiser/gitea-vet v0.1.0/go.mod h1:2Oa6TAdEp1N/38oBNh3ZeiSEER60D/CeDaBFv2sdH58=
@@ -51,6 +53,7 @@ gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGq
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
github.com/360EntSecGroup-Skylar/excelize/v2 v2.0.2 h1:StMrA6UQ5Cm6206DxXGuV/NMqSIOIDoMXMYt8JPe1lE=
github.com/360EntSecGroup-Skylar/excelize/v2 v2.0.2/go.mod h1:EfRHD2k+Kd7ijnqlwOrH1IifwgWB9yYJ0pdXtBZmlpU=
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
@@ -214,6 +217,8 @@ github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/drone/drone-go v1.7.1 h1:ZX+3Rs8YHUSUQ5mkuMLmm1zr1ttiiE2YGNxF3AnyDKw=
github.com/drone/drone-go v1.7.1/go.mod h1:fxCf9jAnXDZV1yDr0ckTuWd1intvcQwfJmTRpTZ1mXg=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
@@ -365,8 +370,9 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=


+ 1
- 1
index.html View File

@@ -149,7 +149,7 @@ var _hmt = _hmt || [];
<!-- <div style="width:1px;background:#606266;height:80%;margin:auto 0.5rem"></div>-->
<div class="item brand" style="margin-left: 0.9rem;">
<a href="/">
<img class="ui mini image" style="width: 253px;margin-right: 30px;" src="/img/git-logo.svg">
<img class="ui mini image" src="/img/gitlogo.png">
</a>
</div>



+ 8
- 8
models/oauth2.go View File

@@ -44,13 +44,13 @@ var OAuth2Providers = map[string]OAuth2Provider{
"openidConnect": {Name: "openidConnect", DisplayName: "OpenID Connect", Image: "/img/auth/openid_connect.svg"},
"twitter": {Name: "twitter", DisplayName: "Twitter", Image: "/img/auth/twitter.png"},
"discord": {Name: "discord", DisplayName: "Discord", Image: "/img/auth/discord.png"},
"openi": {Name: "openi", DisplayName: "openi", Image: "/img/auth/openi.png",
CustomURLMapping: &oauth2.CustomURLMapping{
TokenURL: "https://openi.pcl.ac.cn/login/oauth/access_token",
AuthURL: "https://openi.pcl.ac.cn/login/oauth/authorize",
ProfileURL: "https://openi.pcl.ac.cn/api/v1/user",
},
},
//"gitea": {Name: "gitea", DisplayName: "Gitea", Image: "/img/auth/gitea.png",
// CustomURLMapping: &oauth2.CustomURLMapping{
// TokenURL: oauth2.GetDefaultTokenURL("gitea"),
// AuthURL: oauth2.GetDefaultAuthURL("gitea"),
// ProfileURL: oauth2.GetDefaultProfileURL("gitea"),
// },
//},
"nextcloud": {Name: "nextcloud", DisplayName: "Nextcloud", Image: "/img/auth/nextcloud.png",
CustomURLMapping: &oauth2.CustomURLMapping{
TokenURL: oauth2.GetDefaultTokenURL("nextcloud"),
@@ -67,7 +67,7 @@ var OAuth2Providers = map[string]OAuth2Provider{
var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{
"github": OAuth2Providers["github"].CustomURLMapping,
"gitlab": OAuth2Providers["gitlab"].CustomURLMapping,
"openi": OAuth2Providers["openi"].CustomURLMapping,
"gitea": OAuth2Providers["gitea"].CustomURLMapping,
"nextcloud": OAuth2Providers["nextcloud"].CustomURLMapping,
}



+ 4
- 5
modules/auth/oauth2/oauth2.go View File

@@ -177,11 +177,10 @@ func createProvider(providerName, providerType, clientID, clientSecret, openIDCo
provider = twitter.NewAuthenticate(clientID, clientSecret, callbackURL)
case "discord":
provider = discord.New(clientID, clientSecret, callbackURL, discord.ScopeIdentify, discord.ScopeEmail)
case "openi":
authURL := "https://openi.pcl.ac.cn/login/oauth/authorize"
tokenURL := "https://openi.pcl.ac.cn/login/oauth/access_token"
profileURL := "https://openi.pcl.ac.cn/api/v1/user"

case "gitea":
authURL := gitea.AuthURL
tokenURL := gitea.TokenURL
profileURL := gitea.ProfileURL
if customURLMapping != nil {
if len(customURLMapping.AuthURL) > 0 {
authURL = customURLMapping.AuthURL


+ 2
- 2
modules/setting/setting.go View File

@@ -1784,7 +1784,7 @@ func NewContext() {
BAIDU_AI.URL = sec.Key("URL").MustString("https://aip.baidubce.com/oauth/2.0/token")
BAIDU_AI.LEGAL_TEXT_URL = sec.Key("LEGAL_TEXT_URL").MustString("https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined?access_token=")

GetGrampusConfig()
//GetGrampusConfig()
GetModelartsCDConfig()
getModelConvertConfig()
getModelSafetyConfig()
@@ -1821,7 +1821,7 @@ func GetModelartsConfig() {
ModelArtsMountPath = sec.Key("ModelArts_Mount_Path").MustString("/cache/sfs")
ModelArtsNasType = sec.Key("ModelArts_Nas_Type").MustString("nfs")

getFineTuneConfig()
//getFineTuneConfig()
getFlowControlConfig()
}



+ 6
- 6
modules/storage/storage.go View File

@@ -83,12 +83,12 @@ func Init() error {
return fmt.Errorf("Unsupported attachment store type: %s", setting.Attachment.StoreType)
}

ObsCli, err = obs.New(setting.AccessKeyID, setting.SecretAccessKey, setting.Endpoint)
if err != nil {
log.Error("obs.New failed:", err)
return err
}
//ObsCli, err = obs.New(setting.AccessKeyID, setting.SecretAccessKey, setting.Endpoint)
//
//if err != nil {
// log.Error("obs.New failed:", err)
// return err
//}
log.Info("obs cli inited.")

return nil


BIN
public/img/auth/openi.png View File

Before After
Width: 180  |  Height: 180  |  Size: 7.0 KiB

BIN
public/img/gitlogo.png View File

Before After
Width: 64  |  Height: 64  |  Size: 1.4 KiB

+ 37
- 39
services/ai_task_service/task/task_service.go View File

@@ -4,7 +4,6 @@ import (
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
"path"
"strconv"
@@ -20,7 +19,6 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/routers/response"
"code.gitea.io/gitea/services/ai_task_service/cluster"
creation_context "code.gitea.io/gitea/services/ai_task_service/context"
cloudbrainService "code.gitea.io/gitea/services/cloudbrain"
"code.gitea.io/gitea/services/cloudbrain/cloudbrainTask"
@@ -299,45 +297,45 @@ func UpdateByQueryResponse(res *entity.QueryTaskResponse, task *models.Cloudbrai
var noteBookOKMap = make(map[string]int, 20)
var noteBookFailMap = make(map[string]int, 20)

//if a task notebook url can get successfulCount times, the notebook can browser.
// if a task notebook url can get successfulCount times, the notebook can browser.
const successfulCount = 3
const maxSuccessfulCount = 10

//云脑一存在状态为RUNNING但实际不可用的情况,且存在访问调试链接成功后又失败的情况,因此需要一段时间内多次成功才认为调试可用
//下列代码来源于services/cloudbrain/cloudbrainTask/sync_status.go:118
//func isNoteBookReady(task *models.Cloudbrain) bool
//为了解决循环引用copy了一份到此类,稍有改编
// 云脑一存在状态为RUNNING但实际不可用的情况,且存在访问调试链接成功后又失败的情况,因此需要一段时间内多次成功才认为调试可用
// 下列代码来源于services/cloudbrain/cloudbrainTask/sync_status.go:118
// func isNoteBookReady(task *models.Cloudbrain) bool
// 为了解决循环引用copy了一份到此类,稍有改编
func isCloudbrainOneNotebookReady(jobId string) bool {
url, err := new(cluster.CloudbrainOneClusterAdapter).GetNoteBookUrl(jobId)
if err != nil {
return false
}
if url == "" {
return false
}
res, err := http.Get(url)
if err != nil {
return false
}
if res.StatusCode == http.StatusOK {
count := noteBookOKMap[jobId]
if count == 0 { //如果是第一次成功,把失败数重置为0
noteBookFailMap[jobId] = 0
}
if count < successfulCount-1 || (noteBookFailMap[jobId] == 0 && count < maxSuccessfulCount-1) {
noteBookOKMap[jobId] = count + 1
return false
} else {
log.Info("notebook success count:" + strconv.Itoa(count) + ",fail count:" + strconv.Itoa(noteBookFailMap[jobId]))
delete(noteBookOKMap, jobId)
delete(noteBookFailMap, jobId)
return true
}
} else {
noteBookFailMap[jobId] += 1
}
//url, err := new(cluster.CloudbrainOneClusterAdapter).GetNoteBookUrl(jobId)
//if err != nil {
// return false
//}
//if url == "" {
// return false
//}
//res, err := http.Get(url)
//if err != nil {
// return false
//}
//if res.StatusCode == http.StatusOK {
// count := noteBookOKMap[jobId]
// if count == 0 { //如果是第一次成功,把失败数重置为0
// noteBookFailMap[jobId] = 0
// }
//
// if count < successfulCount-1 || (noteBookFailMap[jobId] == 0 && count < maxSuccessfulCount-1) {
// noteBookOKMap[jobId] = count + 1
// return false
// } else {
// log.Info("notebook success count:" + strconv.Itoa(count) + ",fail count:" + strconv.Itoa(noteBookFailMap[jobId]))
// delete(noteBookOKMap, jobId)
// delete(noteBookFailMap, jobId)
// return true
// }
//
//} else {
// noteBookFailMap[jobId] += 1
//}
return false

}
@@ -393,7 +391,7 @@ func StopTask(id int64, stopRemote StopFunc) error {
return nil
}

//jobId string, baseLine int64, lines int64, order int64
// jobId string, baseLine int64, lines int64, order int64
func QueryTaskLog(opts entity.QueryLogOpts, getLogRemote GetLogFunc) (*entity.ClusterLog, error) {
cloudbrain, err := models.GetCloudbrainByCloudbrainID(opts.CloudbrainId)
if err != nil {
@@ -703,7 +701,7 @@ func GetOperationProfile(id int64, getOperationProfile GetOperationProfileFunc)
return s, err
}

//SyncAITaskStatus 定时更新云脑状态和运行时长
// SyncAITaskStatus 定时更新云脑状态和运行时长
func SyncAITaskStatus() {
defer func() {
if err := recover(); err != nil {


+ 2
- 2
templates/base/head_navbar_fluid.tmpl View File

@@ -1,4 +1,4 @@
<div class="ui fluid container" style = "padding: 0px 20px;" id="navbar">
<div class="ui container" style = "padding: 0px 20px;" id="navbar">
<!-- <div class="item brand" style="justify-content: space-between;">-->
<!-- <a href="https://code-kyxt.pcl.ac.cn/">-->
<!-- <img class="ui mini image" src="{{StaticUrlPrefix}}/img/logo-w.svg">-->
@@ -10,7 +10,7 @@
<!-- <div style="width:1px;background:#606266;height:80%;margin:auto 0.5rem"></div>-->
<div class="item brand" style="margin-left: 0.9rem;">
<a href="/">
<img class="ui mini image" style="width: 253px;margin-right: 30px;" src="{{StaticUrlPrefix}}/img/git-logo.svg">
<img class="ui mini image" src="{{StaticUrlPrefix}}/img/gitlogo.png">
</a>
</div>



+ 1
- 1
templates/base/head_navbar_pro.tmpl View File

@@ -10,7 +10,7 @@
<!-- <div style="width:1px;background:#606266;height:80%;margin:auto 0.5rem"></div>-->
<div class="item brand" style="margin-left: 0.9rem;">
<a href="/">
<img class="ui mini image" style="width: 253px;margin-right: 30px;" src="{{StaticUrlPrefix}}/img/git-logo.svg">
<img class="ui mini image" src="{{StaticUrlPrefix}}/img/git-logo.svg">
</a>
</div>



+ 3
- 0
templates/custom/extra_links.tmpl View File

@@ -1,3 +1,6 @@

<a class="item" href="https://code-kyxt.pcl.ac.cn/login/oauth/authorize?client_id=cf278592-4023-4073-9fb4-5f581190b98d&redirect_uri=https://app-kyxt.pcl.ac.cn/auth/openi/login&response_type=code&state=STATE&redirect_type=shixuns">实训</a>
<a class="item" href="https://code-kyxt.pcl.ac.cn/login/oauth/authorize?client_id=cf278592-4023-4073-9fb4-5f581190b98d&redirect_uri=https://app-kyxt.pcl.ac.cn/auth/openi/login&response_type=code&state=STATE&redirect_type=competitions">竞赛</a>
<a class="item" href="https://data-kyxt.pcl.ac.cn/custom/login">大数据</a>
<a class="item" href="https://aiops-kyxt.pcl.ac.cn/AIStudio/mlops/pipeline/list">AI开发</a>


+ 1
- 29
templates/user/auth/signin_inner.tmpl View File

@@ -75,35 +75,7 @@
</button>
</div>

{{if and .OrderedOAuth2Names .OAuth2Providers}}
<div class="ui centered grid">
<div class="sixteen wide mobile ten wide tablet ten wide computer column">
<div class="oauth2 center">
<div id="oauth2-login-loader" class="ui disabled centered loader"></div>
<div>
<div style="width:367px;margin-left:-74px" id="oauth2-login-navigator">
<div style="display: flex;align-items: center;">
<div style="border-top: 1px solid #d1cfcf;flex: 1;"></div>
<p style="margin: 8px;">{{.i18n.Tr "sign_in_with"}}</p>
<div style="border-top: 1px solid #d1cfcf;flex: 1;"></div>
</div>
{{range $key := .OrderedOAuth2Names}}
{{$provider := index $.OAuth2Providers $key}}
<a href="{{AppSubUrl}}/user/oauth2/{{$key}}">
<img
alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
class="{{$provider.Name}}"
src="{{AppSubUrl}}{{$provider.Image}}"
onclick="window.onOAuthLoginClick()"
></a>
{{end}}
</div>
</div>
</div>
</div>
</div>
{{end}}
</form>
</div>
</div>


+ 3
- 3
vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go View File

@@ -458,7 +458,7 @@ func (pk *PrivateKey) Decrypt(passphrase []byte) error {
}

// DecryptPrivateKeys decrypts all encrypted keys with the given config and passphrase.
// Avoids recomputation of similar s2k key derivations.
// Avoids recomputation of similar s2k key derivations.
func DecryptPrivateKeys(keys []*PrivateKey, passphrase []byte) error {
// Create a cache to avoid recomputation of key derviations for the same passphrase.
s2kCache := &s2k.Cache{}
@@ -485,7 +485,7 @@ func (pk *PrivateKey) encrypt(key []byte, params *s2k.Params, cipherFunction Cip
if len(key) != cipherFunction.KeySize() {
return errors.InvalidArgumentError("supplied encryption key has the wrong size")
}
priv := bytes.NewBuffer(nil)
err := pk.serializePrivateKey(priv)
if err != nil {
@@ -497,7 +497,7 @@ func (pk *PrivateKey) encrypt(key []byte, params *s2k.Params, cipherFunction Cip
pk.s2k, err = pk.s2kParams.Function()
if err != nil {
return err
}
}

privateKeyBytes := priv.Bytes()
pk.sha1Checksum = true


+ 2
- 2
vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go View File

@@ -87,7 +87,7 @@ func decodeCount(c uint8) int {
// encodeMemory converts the Argon2 "memory" in the range parallelism*8 to
// 2**31, inclusive, to an encoded memory. The return value is the
// octet that is actually stored in the GPG file. encodeMemory panics
// if is not in the above range
// if is not in the above range
// See OpenPGP crypto refresh Section 3.7.1.4.
func encodeMemory(memory uint32, parallelism uint8) uint8 {
if memory < (8 * uint32(parallelism)) || memory > uint32(2147483648) {
@@ -211,7 +211,7 @@ func Generate(rand io.Reader, c *Config) (*Params, error) {
c.S2KMode = IteratedSaltedS2K
}
params = &Params{
mode: IteratedSaltedS2K,
mode: IteratedSaltedS2K,
hashId: hashId,
countByte: c.EncodedCount(),
}


+ 1
- 1
vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go View File

@@ -5,7 +5,7 @@ package s2k
// the same parameters.
type Cache map[Params][]byte

// GetOrComputeDerivedKey tries to retrieve the key
// GetOrComputeDerivedKey tries to retrieve the key
// for the given s2k parameters from the cache.
// If there is no hit, it derives the key with the s2k function from the passphrase,
// updates the cache, and returns the key.


+ 2
- 2
vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go View File

@@ -50,9 +50,9 @@ type Config struct {
type Argon2Config struct {
NumberOfPasses uint8
DegreeOfParallelism uint8
// The memory parameter for Argon2 specifies desired memory usage in kibibytes.
// The memory parameter for Argon2 specifies desired memory usage in kibibytes.
// For example memory=64*1024 sets the memory cost to ~64 MB.
Memory uint32
Memory uint32
}

func (c *Config) Mode() Mode {


+ 4
- 4
vendor/github.com/go-git/go-billy/v5/util/walk.go View File

@@ -46,7 +46,7 @@ func walk(fs billy.Filesystem, path string, info os.FileInfo, walkFn filepath.Wa
return nil
}

// Walk walks the file tree rooted at root, calling fn for each file or
// Walk walks the file tree rooted at root, calling fn for each file or
// directory in the tree, including root. All errors that arise visiting files
// and directories are filtered by fn: see the WalkFunc documentation for
// details.
@@ -54,7 +54,7 @@ func walk(fs billy.Filesystem, path string, info os.FileInfo, walkFn filepath.Wa
// The files are walked in lexical order, which makes the output deterministic
// but requires Walk to read an entire directory into memory before proceeding
// to walk that directory. Walk does not follow symbolic links.
//
//
// Function adapted from https://github.com/golang/go/blob/3b770f2ccb1fa6fecc22ea822a19447b10b70c5c/src/path/filepath/path.go#L500
func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error {
info, err := fs.Lstat(root)
@@ -63,10 +63,10 @@ func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error {
} else {
err = walk(fs, root, info, walkFn)
}
if err == filepath.SkipDir {
return nil
}
return err
}

+ 6
- 1
vendor/github.com/golang/snappy/README View File

@@ -1,8 +1,13 @@
The Snappy compression format in the Go programming language.

To download and install from source:
To use as a library:
$ go get github.com/golang/snappy

To use as a binary:
$ go install github.com/golang/snappy/cmd/snappytool@latest
$ cat decoded | ~/go/bin/snappytool -e > encoded
$ cat encoded | ~/go/bin/snappytool -d > decoded

Unless otherwise noted, the Snappy-Go source files are distributed
under the BSD-style license found in the LICENSE file.



+ 2
- 2
vendor/github.com/golang/snappy/encode_arm64.s View File

@@ -27,7 +27,7 @@
// The unusual register allocation of local variables, such as R10 for the
// source pointer, matches the allocation used at the call site in encodeBlock,
// which makes it easier to manually inline this function.
TEXT ·emitLiteral(SB), NOSPLIT, $32-56
TEXT ·emitLiteral(SB), NOSPLIT, $40-56
MOVD dst_base+0(FP), R8
MOVD lit_base+24(FP), R10
MOVD lit_len+32(FP), R3
@@ -261,7 +261,7 @@ extendMatchEnd:
// "var table [maxTableSize]uint16" takes up 32768 bytes of stack space. An
// extra 64 bytes, to call other functions, and an extra 64 bytes, to spill
// local variables (registers) during calls gives 32768 + 64 + 64 = 32896.
TEXT ·encodeBlock(SB), 0, $32896-56
TEXT ·encodeBlock(SB), 0, $32904-56
MOVD dst_base+0(FP), R8
MOVD src_base+24(FP), R7
MOVD src_len+32(FP), R14


+ 1
- 1
vendor/github.com/imdario/mergo/.deepsource.toml View File

@@ -9,4 +9,4 @@ name = "go"
enabled = true

[analyzers.meta]
import_path = "github.com/imdario/mergo"
import_path = "github.com/imdario/mergo"

+ 6
- 70
vendor/github.com/stretchr/testify/assert/assertion_compare.go View File

@@ -1,10 +1,8 @@
package assert

import (
"bytes"
"fmt"
"reflect"
"time"
)

type CompareType int
@@ -32,9 +30,6 @@ var (
float64Type = reflect.TypeOf(float64(1))

stringType = reflect.TypeOf("")

timeType = reflect.TypeOf(time.Time{})
bytesType = reflect.TypeOf([]byte{})
)

func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) {
@@ -304,47 +299,6 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) {
return compareLess, true
}
}
// Check for known struct types we can check for compare results.
case reflect.Struct:
{
// All structs enter here. We're not interested in most types.
if !canConvert(obj1Value, timeType) {
break
}

// time.Time can compared!
timeObj1, ok := obj1.(time.Time)
if !ok {
timeObj1 = obj1Value.Convert(timeType).Interface().(time.Time)
}

timeObj2, ok := obj2.(time.Time)
if !ok {
timeObj2 = obj2Value.Convert(timeType).Interface().(time.Time)
}

return compare(timeObj1.UnixNano(), timeObj2.UnixNano(), reflect.Int64)
}
case reflect.Slice:
{
// We only care about the []byte type.
if !canConvert(obj1Value, bytesType) {
break
}

// []byte can be compared!
bytesObj1, ok := obj1.([]byte)
if !ok {
bytesObj1 = obj1Value.Convert(bytesType).Interface().([]byte)

}
bytesObj2, ok := obj2.([]byte)
if !ok {
bytesObj2 = obj2Value.Convert(bytesType).Interface().([]byte)
}

return CompareType(bytes.Compare(bytesObj1, bytesObj2)), true
}
}

return compareEqual, false
@@ -356,10 +310,7 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) {
// assert.Greater(t, float64(2), float64(1))
// assert.Greater(t, "b", "a")
func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
return compareTwoValues(t, e1, e2, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...)
return compareTwoValues(t, e1, e2, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs)
}

// GreaterOrEqual asserts that the first element is greater than or equal to the second
@@ -369,10 +320,7 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface
// assert.GreaterOrEqual(t, "b", "a")
// assert.GreaterOrEqual(t, "b", "b")
func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
return compareTwoValues(t, e1, e2, []CompareType{compareGreater, compareEqual}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...)
return compareTwoValues(t, e1, e2, []CompareType{compareGreater, compareEqual}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs)
}

// Less asserts that the first element is less than the second
@@ -381,10 +329,7 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in
// assert.Less(t, float64(1), float64(2))
// assert.Less(t, "a", "b")
func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
return compareTwoValues(t, e1, e2, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...)
return compareTwoValues(t, e1, e2, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs)
}

// LessOrEqual asserts that the first element is less than or equal to the second
@@ -394,10 +339,7 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{})
// assert.LessOrEqual(t, "a", "b")
// assert.LessOrEqual(t, "b", "b")
func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...)
return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs)
}

// Positive asserts that the specified element is positive
@@ -405,11 +347,8 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter
// assert.Positive(t, 1)
// assert.Positive(t, 1.23)
func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
zero := reflect.Zero(reflect.TypeOf(e))
return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs...)
return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs)
}

// Negative asserts that the specified element is negative
@@ -417,11 +356,8 @@ func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
// assert.Negative(t, -1)
// assert.Negative(t, -1.23)
func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
zero := reflect.Zero(reflect.TypeOf(e))
return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs...)
return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs)
}

func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool {


+ 0
- 16
vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go View File

@@ -1,16 +0,0 @@
//go:build go1.17
// +build go1.17

// TODO: once support for Go 1.16 is dropped, this file can be
// merged/removed with assertion_compare_go1.17_test.go and
// assertion_compare_legacy.go

package assert

import "reflect"

// Wrapper around reflect.Value.CanConvert, for compatibility
// reasons.
func canConvert(value reflect.Value, to reflect.Type) bool {
return value.CanConvert(to)
}

+ 0
- 16
vendor/github.com/stretchr/testify/assert/assertion_compare_legacy.go View File

@@ -1,16 +0,0 @@
//go:build !go1.17
// +build !go1.17

// TODO: once support for Go 1.16 is dropped, this file can be
// merged/removed with assertion_compare_go1.17_test.go and
// assertion_compare_can_convert.go

package assert

import "reflect"

// Older versions of Go does not have the reflect.Value.CanConvert
// method.
func canConvert(value reflect.Value, to reflect.Type) bool {
return false
}

+ 0
- 22
vendor/github.com/stretchr/testify/assert/assertion_format.go View File

@@ -123,18 +123,6 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int
return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...)
}

// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
return ErrorContains(t, theError, contains, append([]interface{}{msg}, args...)...)
}

// ErrorIsf asserts that at least one of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool {
@@ -736,16 +724,6 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim
return WithinDuration(t, expected, actual, delta, append([]interface{}{msg}, args...)...)
}

// WithinRangef asserts that a time is within a time range (inclusive).
//
// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
return WithinRange(t, actual, start, end, append([]interface{}{msg}, args...)...)
}

// YAMLEqf asserts that two YAML strings are equivalent.
func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {


+ 0
- 44
vendor/github.com/stretchr/testify/assert/assertion_forward.go View File

@@ -222,30 +222,6 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ..
return ErrorAsf(a.t, err, target, msg, args...)
}

// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// a.ErrorContains(err, expectedErrorSubString)
func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
return ErrorContains(a.t, theError, contains, msgAndArgs...)
}

// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
return ErrorContainsf(a.t, theError, contains, msg, args...)
}

// ErrorIs asserts that at least one of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool {
@@ -1461,26 +1437,6 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta
return WithinDurationf(a.t, expected, actual, delta, msg, args...)
}

// WithinRange asserts that a time is within a time range (inclusive).
//
// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
return WithinRange(a.t, actual, start, end, msgAndArgs...)
}

// WithinRangef asserts that a time is within a time range (inclusive).
//
// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
return WithinRangef(a.t, actual, start, end, msg, args...)
}

// YAMLEq asserts that two YAML strings are equivalent.
func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {


+ 4
- 4
vendor/github.com/stretchr/testify/assert/assertion_order.go View File

@@ -50,7 +50,7 @@ func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareT
// assert.IsIncreasing(t, []float{1, 2})
// assert.IsIncreasing(t, []string{"a", "b"})
func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...)
return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs)
}

// IsNonIncreasing asserts that the collection is not increasing
@@ -59,7 +59,7 @@ func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) boo
// assert.IsNonIncreasing(t, []float{2, 1})
// assert.IsNonIncreasing(t, []string{"b", "a"})
func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...)
return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs)
}

// IsDecreasing asserts that the collection is decreasing
@@ -68,7 +68,7 @@ func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{})
// assert.IsDecreasing(t, []float{2, 1})
// assert.IsDecreasing(t, []string{"b", "a"})
func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...)
return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs)
}

// IsNonDecreasing asserts that the collection is not decreasing
@@ -77,5 +77,5 @@ func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) boo
// assert.IsNonDecreasing(t, []float{1, 2})
// assert.IsNonDecreasing(t, []string{"a", "b"})
func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...)
return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs)
}

+ 48
- 142
vendor/github.com/stretchr/testify/assert/assertions.go View File

@@ -8,7 +8,6 @@ import (
"fmt"
"math"
"os"
"path/filepath"
"reflect"
"regexp"
"runtime"
@@ -145,8 +144,7 @@ func CallerInfo() []string {
if len(parts) > 1 {
dir := parts[len(parts)-2]
if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" {
path, _ := filepath.Abs(file)
callers = append(callers, fmt.Sprintf("%s:%d", path, line))
callers = append(callers, fmt.Sprintf("%s:%d", file, line))
}
}

@@ -565,17 +563,16 @@ func isEmpty(object interface{}) bool {

switch objValue.Kind() {
// collection types are empty when they have no element
case reflect.Chan, reflect.Map, reflect.Slice:
case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
return objValue.Len() == 0
// pointers are empty if nil or if the value they point to is empty
// pointers are empty if nil or if the value they point to is empty
case reflect.Ptr:
if objValue.IsNil() {
return true
}
deref := objValue.Elem().Interface()
return isEmpty(deref)
// for all other types, compare against the zero value
// array types are empty when they match their zero-initialized state
// for all other types, compare against the zero value
default:
zero := reflect.Zero(objValue.Type())
return reflect.DeepEqual(object, zero.Interface())
@@ -721,14 +718,10 @@ func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...inte
// return (false, false) if impossible.
// return (true, false) if element was not found.
// return (true, true) if element was found.
func containsElement(list interface{}, element interface{}) (ok, found bool) {
func includeElement(list interface{}, element interface{}) (ok, found bool) {

listValue := reflect.ValueOf(list)
listType := reflect.TypeOf(list)
if listType == nil {
return false, false
}
listKind := listType.Kind()
listKind := reflect.TypeOf(list).Kind()
defer func() {
if e := recover(); e != nil {
ok = false
@@ -771,7 +764,7 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo
h.Helper()
}

ok, found := containsElement(s, contains)
ok, found := includeElement(s, contains)
if !ok {
return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
}
@@ -794,7 +787,7 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
h.Helper()
}

ok, found := containsElement(s, contains)
ok, found := includeElement(s, contains)
if !ok {
return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
}
@@ -818,6 +811,7 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
return true // we consider nil to be equal to the nil set
}

subsetValue := reflect.ValueOf(subset)
defer func() {
if e := recover(); e != nil {
ok = false
@@ -827,35 +821,17 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
listKind := reflect.TypeOf(list).Kind()
subsetKind := reflect.TypeOf(subset).Kind()

if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map {
if listKind != reflect.Array && listKind != reflect.Slice {
return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...)
}

if subsetKind != reflect.Array && subsetKind != reflect.Slice && listKind != reflect.Map {
if subsetKind != reflect.Array && subsetKind != reflect.Slice {
return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...)
}

subsetValue := reflect.ValueOf(subset)
if subsetKind == reflect.Map && listKind == reflect.Map {
listValue := reflect.ValueOf(list)
subsetKeys := subsetValue.MapKeys()

for i := 0; i < len(subsetKeys); i++ {
subsetKey := subsetKeys[i]
subsetElement := subsetValue.MapIndex(subsetKey).Interface()
listElement := listValue.MapIndex(subsetKey).Interface()

if !ObjectsAreEqual(subsetElement, listElement) {
return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", list, subsetElement), msgAndArgs...)
}
}

return true
}

for i := 0; i < subsetValue.Len(); i++ {
element := subsetValue.Index(i).Interface()
ok, found := containsElement(list, element)
ok, found := includeElement(list, element)
if !ok {
return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", list), msgAndArgs...)
}
@@ -876,9 +852,10 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{})
h.Helper()
}
if subset == nil {
return Fail(t, "nil is the empty set which is a subset of every set", msgAndArgs...)
return Fail(t, fmt.Sprintf("nil is the empty set which is a subset of every set"), msgAndArgs...)
}

subsetValue := reflect.ValueOf(subset)
defer func() {
if e := recover(); e != nil {
ok = false
@@ -888,35 +865,17 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{})
listKind := reflect.TypeOf(list).Kind()
subsetKind := reflect.TypeOf(subset).Kind()

if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map {
if listKind != reflect.Array && listKind != reflect.Slice {
return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...)
}

if subsetKind != reflect.Array && subsetKind != reflect.Slice && listKind != reflect.Map {
if subsetKind != reflect.Array && subsetKind != reflect.Slice {
return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...)
}

subsetValue := reflect.ValueOf(subset)
if subsetKind == reflect.Map && listKind == reflect.Map {
listValue := reflect.ValueOf(list)
subsetKeys := subsetValue.MapKeys()

for i := 0; i < len(subsetKeys); i++ {
subsetKey := subsetKeys[i]
subsetElement := subsetValue.MapIndex(subsetKey).Interface()
listElement := listValue.MapIndex(subsetKey).Interface()

if !ObjectsAreEqual(subsetElement, listElement) {
return true
}
}

return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...)
}

for i := 0; i < subsetValue.Len(); i++ {
element := subsetValue.Index(i).Interface()
ok, found := containsElement(list, element)
ok, found := includeElement(list, element)
if !ok {
return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", list), msgAndArgs...)
}
@@ -1041,21 +1000,27 @@ func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool {
type PanicTestFunc func()

// didPanic returns true if the function passed to it panics. Otherwise, it returns false.
func didPanic(f PanicTestFunc) (didPanic bool, message interface{}, stack string) {
didPanic = true
func didPanic(f PanicTestFunc) (bool, interface{}, string) {

didPanic := false
var message interface{}
var stack string
func() {

defer func() {
if message = recover(); message != nil {
didPanic = true
stack = string(debug.Stack())
}
}()

// call the target function
f()

defer func() {
message = recover()
if didPanic {
stack = string(debug.Stack())
}
}()

// call the target function
f()
didPanic = false
return didPanic, message, stack

return
}

// Panics asserts that the code inside the specified PanicTestFunc panics.
@@ -1146,27 +1111,6 @@ func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration,
return true
}

// WithinRange asserts that a time is within a time range (inclusive).
//
// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func WithinRange(t TestingT, actual, start, end time.Time, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}

if end.Before(start) {
return Fail(t, "Start should be before end", msgAndArgs...)
}

if actual.Before(start) {
return Fail(t, fmt.Sprintf("Time %v expected to be in time range %v to %v, but is before the range", actual, start, end), msgAndArgs...)
} else if actual.After(end) {
return Fail(t, fmt.Sprintf("Time %v expected to be in time range %v to %v, but is after the range", actual, start, end), msgAndArgs...)
}

return true
}

func toFloat(x interface{}) (float64, bool) {
var xf float64
xok := true
@@ -1217,15 +1161,11 @@ func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs
bf, bok := toFloat(actual)

if !aok || !bok {
return Fail(t, "Parameters must be numerical", msgAndArgs...)
}

if math.IsNaN(af) && math.IsNaN(bf) {
return true
return Fail(t, fmt.Sprintf("Parameters must be numerical"), msgAndArgs...)
}

if math.IsNaN(af) {
return Fail(t, "Expected must not be NaN", msgAndArgs...)
return Fail(t, fmt.Sprintf("Expected must not be NaN"), msgAndArgs...)
}

if math.IsNaN(bf) {
@@ -1248,7 +1188,7 @@ func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAn
if expected == nil || actual == nil ||
reflect.TypeOf(actual).Kind() != reflect.Slice ||
reflect.TypeOf(expected).Kind() != reflect.Slice {
return Fail(t, "Parameters must be slice", msgAndArgs...)
return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...)
}

actualSlice := reflect.ValueOf(actual)
@@ -1310,12 +1250,8 @@ func InDeltaMapValues(t TestingT, expected, actual interface{}, delta float64, m

func calcRelativeError(expected, actual interface{}) (float64, error) {
af, aok := toFloat(expected)
bf, bok := toFloat(actual)
if !aok || !bok {
return 0, fmt.Errorf("Parameters must be numerical")
}
if math.IsNaN(af) && math.IsNaN(bf) {
return 0, nil
if !aok {
return 0, fmt.Errorf("expected value %q cannot be converted to float", expected)
}
if math.IsNaN(af) {
return 0, errors.New("expected value must not be NaN")
@@ -1323,6 +1259,10 @@ func calcRelativeError(expected, actual interface{}) (float64, error) {
if af == 0 {
return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error")
}
bf, bok := toFloat(actual)
if !bok {
return 0, fmt.Errorf("actual value %q cannot be converted to float", actual)
}
if math.IsNaN(bf) {
return 0, errors.New("actual value must not be NaN")
}
@@ -1358,7 +1298,7 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m
if expected == nil || actual == nil ||
reflect.TypeOf(actual).Kind() != reflect.Slice ||
reflect.TypeOf(expected).Kind() != reflect.Slice {
return Fail(t, "Parameters must be slice", msgAndArgs...)
return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...)
}

actualSlice := reflect.ValueOf(actual)
@@ -1435,27 +1375,6 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte
return true
}

// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// assert.ErrorContains(t, err, expectedErrorSubString)
func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
if !Error(t, theError, msgAndArgs...) {
return false
}

actual := theError.Error()
if !strings.Contains(actual, contains) {
return Fail(t, fmt.Sprintf("Error %#v does not contain %#v", actual, contains), msgAndArgs...)
}

return true
}

// matchRegexp return true if a specified regexp matches a string.
func matchRegexp(rx interface{}, str interface{}) bool {

@@ -1669,17 +1588,12 @@ func diff(expected interface{}, actual interface{}) string {
}

var e, a string

switch et {
case reflect.TypeOf(""):
e = reflect.ValueOf(expected).String()
a = reflect.ValueOf(actual).String()
case reflect.TypeOf(time.Time{}):
e = spewConfigStringerEnabled.Sdump(expected)
a = spewConfigStringerEnabled.Sdump(actual)
default:
if et != reflect.TypeOf("") {
e = spewConfig.Sdump(expected)
a = spewConfig.Sdump(actual)
} else {
e = reflect.ValueOf(expected).String()
a = reflect.ValueOf(actual).String()
}

diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
@@ -1711,14 +1625,6 @@ var spewConfig = spew.ConfigState{
MaxDepth: 10,
}

var spewConfigStringerEnabled = spew.ConfigState{
Indent: " ",
DisablePointerAddresses: true,
DisableCapacities: true,
SortKeys: true,
MaxDepth: 10,
}

type tHelper interface {
Helper()
}


+ 0
- 56
vendor/github.com/stretchr/testify/require/require.go View File

@@ -280,36 +280,6 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int
t.FailNow()
}

// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// assert.ErrorContains(t, err, expectedErrorSubString)
func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
if assert.ErrorContains(t, theError, contains, msgAndArgs...) {
return
}
t.FailNow()
}

// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
if assert.ErrorContainsf(t, theError, contains, msg, args...) {
return
}
t.FailNow()
}

// ErrorIs asserts that at least one of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) {
@@ -1864,32 +1834,6 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim
t.FailNow()
}

// WithinRange asserts that a time is within a time range (inclusive).
//
// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
if assert.WithinRange(t, actual, start, end, msgAndArgs...) {
return
}
t.FailNow()
}

// WithinRangef asserts that a time is within a time range (inclusive).
//
// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
if assert.WithinRangef(t, actual, start, end, msg, args...) {
return
}
t.FailNow()
}

// YAMLEq asserts that two YAML strings are equivalent.
func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {


+ 0
- 44
vendor/github.com/stretchr/testify/require/require_forward.go View File

@@ -223,30 +223,6 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ..
ErrorAsf(a.t, err, target, msg, args...)
}

// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// a.ErrorContains(err, expectedErrorSubString)
func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
ErrorContains(a.t, theError, contains, msgAndArgs...)
}

// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
ErrorContainsf(a.t, theError, contains, msg, args...)
}

// ErrorIs asserts that at least one of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) {
@@ -1462,26 +1438,6 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta
WithinDurationf(a.t, expected, actual, delta, msg, args...)
}

// WithinRange asserts that a time is within a time range (inclusive).
//
// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
WithinRange(a.t, actual, start, end, msgAndArgs...)
}

// WithinRangef asserts that a time is within a time range (inclusive).
//
// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
}
WithinRangef(a.t, actual, start, end, msg, args...)
}

// YAMLEq asserts that two YAML strings are equivalent.
func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {


+ 0
- 0
vendor/golang.org/x/crypto/ed25519/ed25519.go View File


+ 3
- 0
vendor/golang.org/x/image/AUTHORS View File

@@ -0,0 +1,3 @@
# This source code refers to The Go Authors for copyright purposes.
# The master list of authors is in the main Go distribution,
# visible at http://tip.golang.org/AUTHORS.

+ 3
- 0
vendor/golang.org/x/image/CONTRIBUTORS View File

@@ -0,0 +1,3 @@
# This source code was written by the Go contributors.
# The master list of contributors is in the main Go distribution,
# visible at http://tip.golang.org/CONTRIBUTORS.

+ 0
- 6
vendor/golang.org/x/image/bmp/reader.go View File

@@ -144,9 +144,6 @@ func decodeConfig(r io.Reader) (config image.Config, bitsPerPixel int, topDown b
)
var b [1024]byte
if _, err := io.ReadFull(r, b[:fileHeaderLen+4]); err != nil {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
return image.Config{}, 0, false, err
}
if string(b[:2]) != "BM" {
@@ -158,9 +155,6 @@ func decodeConfig(r io.Reader) (config image.Config, bitsPerPixel int, topDown b
return image.Config{}, 0, false, ErrUnsupported
}
if _, err := io.ReadFull(r, b[fileHeaderLen+4:fileHeaderLen+infoLen]); err != nil {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
return image.Config{}, 0, false, err
}
width := int(int32(readUint32(b[18:22])))


+ 29
- 127
vendor/golang.org/x/image/ccitt/reader.go View File

@@ -16,7 +16,6 @@ import (
)

var (
errIncompleteCode = errors.New("ccitt: incomplete code")
errInvalidBounds = errors.New("ccitt: invalid bounds")
errInvalidCode = errors.New("ccitt: invalid code")
errInvalidMode = errors.New("ccitt: invalid mode")
@@ -49,10 +48,6 @@ const (
Group4
)

// AutoDetectHeight is passed as the height argument to NewReader to indicate
// that the image height (the number of rows) is not known in advance.
const AutoDetectHeight = -1

// Options are optional parameters.
type Options struct {
// Align means that some variable-bit-width codes are byte-aligned.
@@ -210,14 +205,10 @@ func decode(b *bitReader, decodeTable [][2]int16) (uint32, error) {
for {
bit, err := b.nextBit()
if err != nil {
if err == io.EOF {
err = errIncompleteCode
}
return 0, err
}
bitsRead |= bit << (63 - nBitsRead)
nBitsRead++

// The "&1" is redundant, but can eliminate a bounds check.
state = int32(decodeTable[state][bit&1])
if state < 0 {
@@ -231,35 +222,6 @@ func decode(b *bitReader, decodeTable [][2]int16) (uint32, error) {
}
}

// decodeEOL decodes the 12-bit EOL code 0000_0000_0001.
func decodeEOL(b *bitReader) error {
nBitsRead, bitsRead := uint32(0), uint64(0)
for {
bit, err := b.nextBit()
if err != nil {
if err == io.EOF {
err = errMissingEOL
}
return err
}
bitsRead |= bit << (63 - nBitsRead)
nBitsRead++

if nBitsRead < 12 {
if bit&1 == 0 {
continue
}
} else if bit&1 != 0 {
return nil
}

// Unread the bits we've read, then return errMissingEOL.
b.bits = (b.bits >> nBitsRead) | bitsRead
b.nBits += nBitsRead
return errMissingEOL
}
}

type reader struct {
br bitReader
subFormat SubFormat
@@ -269,10 +231,7 @@ type reader struct {

// rowsRemaining starts at the image height in pixels, when the reader is
// driven through the io.Reader interface, and decrements to zero as rows
// are decoded. Alternatively, it may be negative if the image height is
// not known in advance at the time of the NewReader call.
//
// When driven through DecodeIntoGray, this field is unused.
// are decoded. When driven through DecodeIntoGray, this field is unused.
rowsRemaining int

// curr and prev hold the current and previous rows. Each element is either
@@ -310,19 +269,6 @@ type reader struct {
// seenStartOfImage is whether we've called the startDecode method.
seenStartOfImage bool

// truncated is whether the input is missing the final 6 consecutive EOL's
// (for Group3) or 2 consecutive EOL's (for Group4). Omitting that trailer
// (but otherwise padding to a byte boundary, with either all 0 bits or all
// 1 bits) is invalid according to the spec, but happens in practice when
// exporting from Adobe Acrobat to TIFF + CCITT. This package silently
// ignores the format error for CCITT input that has been truncated in that
// fashion, returning the full decoded image.
//
// Detecting trailer truncation (just after the final row of pixels)
// requires knowing which row is the final row, and therefore does not
// trigger if the image height is not known in advance.
truncated bool

// readErr is a sticky error for the Read method.
readErr error
}
@@ -348,50 +294,17 @@ func (z *reader) Read(p []byte) (int, error) {

// Decode the next row, if necessary.
if z.atStartOfRow {
if z.rowsRemaining < 0 {
// We do not know the image height in advance. See if the next
// code is an EOL. If it is, it is consumed. If it isn't, the
// bitReader shouldn't advance along the bit stream, and we
// simply decode another row of pixel data.
//
// For the Group4 subFormat, we may need to align to a byte
// boundary. For the Group3 subFormat, the previous z.decodeRow
// call (or z.startDecode call) has already consumed one of the
// 6 consecutive EOL's. The next EOL is actually the second of
// 6, in the middle, and we shouldn't align at that point.
if z.align && (z.subFormat == Group4) {
z.br.alignToByteBoundary()
}

if err := z.decodeEOL(); err == errMissingEOL {
// No-op. It's another row of pixel data.
} else if err != nil {
z.readErr = err
break
} else {
if z.readErr = z.finishDecode(true); z.readErr != nil {
break
}
z.readErr = io.EOF
break
}

} else if z.rowsRemaining == 0 {
// We do know the image height in advance, and we have already
// decoded exactly that many rows.
if z.readErr = z.finishDecode(false); z.readErr != nil {
if z.rowsRemaining <= 0 {
if z.readErr = z.finishDecode(); z.readErr != nil {
break
}
z.readErr = io.EOF
break

} else {
z.rowsRemaining--
}

if z.readErr = z.decodeRow(z.rowsRemaining == 0); z.readErr != nil {
if z.readErr = z.decodeRow(); z.readErr != nil {
break
}
z.rowsRemaining--
}

// Pack from z.curr (1 byte per pixel) to p (1 bit per pixel).
@@ -438,44 +351,32 @@ func (z *reader) startDecode() error {
return nil
}

func (z *reader) finishDecode(alreadySeenEOL bool) error {
func (z *reader) finishDecode() error {
numberOfEOLs := 0
switch z.subFormat {
case Group3:
if z.truncated {
return nil
}
// The stream ends with a RTC (Return To Control) of 6 consecutive
// EOL's, but we should have already just seen an EOL, either in
// z.startDecode (for a zero-height image) or in z.decodeRow.
numberOfEOLs = 5

case Group4:
autoDetectHeight := z.rowsRemaining < 0
if autoDetectHeight {
// Aligning to a byte boundary was already handled by reader.Read.
} else if z.align {
// The stream ends with two EOL's, the first of which is possibly
// byte-aligned.
numberOfEOLs = 2
if err := z.decodeEOL(); err == nil {
numberOfEOLs--
} else if err == errInvalidCode {
// Try again, this time starting from a byte boundary.
z.br.alignToByteBoundary()
}
// The stream ends with two EOL's. If the first one is missing, and we
// had an explicit image height, we just assume that the trailing two
// EOL's were truncated and return a nil error.
if err := z.decodeEOL(); err != nil {
if (err == errMissingEOL) && !autoDetectHeight {
z.truncated = true
return nil
}
} else {
return err
}
numberOfEOLs = 1

default:
return errUnsupportedSubFormat
}

if alreadySeenEOL {
numberOfEOLs--
}
for ; numberOfEOLs > 0; numberOfEOLs-- {
if err := z.decodeEOL(); err != nil {
return err
@@ -485,10 +386,19 @@ func (z *reader) finishDecode(alreadySeenEOL bool) error {
}

func (z *reader) decodeEOL() error {
return decodeEOL(&z.br)
// TODO: EOL doesn't have to be in the modeDecodeTable. It could be in its
// own table, or we could just hard-code it, especially if we might need to
// cater for optional byte-alignment, or an arbitrary number (potentially
// more than 8) of 0-valued padding bits.
if mode, err := decode(&z.br, modeDecodeTable[:]); err != nil {
return err
} else if mode != modeEOL {
return errMissingEOL
}
return nil
}

func (z *reader) decodeRow(finalRow bool) error {
func (z *reader) decodeRow() error {
z.wi = 0
z.atStartOfRow = true
z.penColorIsWhite = true
@@ -504,12 +414,7 @@ func (z *reader) decodeRow(finalRow bool) error {
return err
}
}
err := z.decodeEOL()
if finalRow && (err == errMissingEOL) {
z.truncated = true
return nil
}
return err
return z.decodeEOL()

case Group4:
for ; z.wi < len(z.curr); z.atStartOfRow = false {
@@ -749,13 +654,13 @@ func DecodeIntoGray(dst *image.Gray, r io.Reader, order Order, sf SubFormat, opt
for y := bounds.Min.Y; y < bounds.Max.Y; y++ {
p := (y - bounds.Min.Y) * dst.Stride
z.curr = dst.Pix[p : p+width]
if err := z.decodeRow(y+1 == bounds.Max.Y); err != nil {
if err := z.decodeRow(); err != nil {
return err
}
z.curr, z.prev = nil, z.curr
}

if err := z.finishDecode(false); err != nil {
if err := z.finishDecode(); err != nil {
return err
}

@@ -772,12 +677,9 @@ func DecodeIntoGray(dst *image.Gray, r io.Reader, order Order, sf SubFormat, opt
// NewReader returns an io.Reader that decodes the CCITT-formatted data in r.
// The resultant byte stream is one bit per pixel (MSB first), with 1 meaning
// white and 0 meaning black. Each row in the result is byte-aligned.
//
// A negative height, such as passing AutoDetectHeight, means that the image
// height is not known in advance. A negative width is invalid.
func NewReader(r io.Reader, order Order, sf SubFormat, width int, height int, opts *Options) io.Reader {
readErr := error(nil)
if width < 0 {
if (width < 0) || (height < 0) {
readErr = errInvalidBounds
} else if width > maxWidth {
readErr = errUnsupportedWidth


+ 467
- 450
vendor/golang.org/x/image/ccitt/table.go View File

@@ -31,27 +31,37 @@ package ccitt

// modeDecodeTable represents Table 1 and the End-of-Line code.
//
// +=XXXXX
// b009 +-+
// | +=v0009
// b007 +-+
// | | +=v0008
// b010 | +-+
// | +=v0005
// b006 +-+
// | | +=v0007
// b008 | +-+
// | +=v0004
// b005 +-+
// | +=v0000
// b003 +-+
// | +=v0001
// b002 +-+
// | | +=v0006
// b004 | +-+
// | +=v0003
// b001 +-+
// +=v0002
// +=XXXXX
// b015 +-+
// | +=v0010
// b014 +-+
// | +=XXXXX
// b013 +-+
// | +=XXXXX
// b012 +-+
// | +=XXXXX
// b011 +-+
// | +=XXXXX
// b009 +-+
// | +=v0009
// b007 +-+
// | | +=v0008
// b010 | +-+
// | +=v0005
// b006 +-+
// | | +=v0007
// b008 | +-+
// | +=v0004
// b005 +-+
// | +=v0000
// b003 +-+
// | +=v0001
// b002 +-+
// | | +=v0006
// b004 | +-+
// | +=v0003
// b001 +-+
// +=v0002
var modeDecodeTable = [...][2]int16{
0: {0, 0},
1: {2, ^2},
@@ -62,221 +72,226 @@ var modeDecodeTable = [...][2]int16{
6: {7, 8},
7: {9, 10},
8: {^7, ^4},
9: {0, ^9},
9: {11, ^9},
10: {^8, ^5},
11: {12, 0},
12: {13, 0},
13: {14, 0},
14: {15, 0},
15: {0, ^10},
}

// whiteDecodeTable represents Tables 2 and 3 for a white run.
//
// +=XXXXX
// b059 +-+
// | | +=v1792
// b096 | | +-+
// | | | | +=v1984
// b100 | | | +-+
// | | | +=v2048
// b094 | | +-+
// | | | | +=v2112
// b101 | | | | +-+
// | | | | | +=v2176
// b097 | | | +-+
// | | | | +=v2240
// b102 | | | +-+
// | | | +=v2304
// b085 | +-+
// | | +=v1856
// b098 | | +-+
// | | | +=v1920
// b095 | +-+
// | | +=v2368
// b103 | | +-+
// | | | +=v2432
// b099 | +-+
// | | +=v2496
// b104 | +-+
// | +=v2560
// b040 +-+
// | | +=v0029
// b060 | +-+
// | +=v0030
// b026 +-+
// | | +=v0045
// b061 | | +-+
// | | | +=v0046
// b041 | +-+
// | +=v0022
// b016 +-+
// | | +=v0023
// b042 | | +-+
// | | | | +=v0047
// b062 | | | +-+
// | | | +=v0048
// b027 | +-+
// | +=v0013
// b008 +-+
// | | +=v0020
// b043 | | +-+
// | | | | +=v0033
// b063 | | | +-+
// | | | +=v0034
// b028 | | +-+
// | | | | +=v0035
// b064 | | | | +-+
// | | | | | +=v0036
// b044 | | | +-+
// | | | | +=v0037
// b065 | | | +-+
// | | | +=v0038
// b017 | +-+
// | | +=v0019
// b045 | | +-+
// | | | | +=v0031
// b066 | | | +-+
// | | | +=v0032
// b029 | +-+
// | +=v0001
// b004 +-+
// | | +=v0012
// b030 | | +-+
// | | | | +=v0053
// b067 | | | | +-+
// | | | | | +=v0054
// b046 | | | +-+
// | | | +=v0026
// b018 | | +-+
// | | | | +=v0039
// b068 | | | | +-+
// | | | | | +=v0040
// b047 | | | | +-+
// | | | | | | +=v0041
// b069 | | | | | +-+
// | | | | | +=v0042
// b031 | | | +-+
// | | | | +=v0043
// b070 | | | | +-+
// | | | | | +=v0044
// b048 | | | +-+
// | | | +=v0021
// b009 | +-+
// | | +=v0028
// b049 | | +-+
// | | | | +=v0061
// b071 | | | +-+
// | | | +=v0062
// b032 | | +-+
// | | | | +=v0063
// b072 | | | | +-+
// | | | | | +=v0000
// b050 | | | +-+
// | | | | +=v0320
// b073 | | | +-+
// | | | +=v0384
// b019 | +-+
// | +=v0010
// b002 +-+
// | | +=v0011
// b020 | | +-+
// | | | | +=v0027
// b051 | | | | +-+
// | | | | | | +=v0059
// b074 | | | | | +-+
// | | | | | +=v0060
// b033 | | | +-+
// | | | | +=v1472
// b086 | | | | +-+
// | | | | | +=v1536
// b075 | | | | +-+
// | | | | | | +=v1600
// b087 | | | | | +-+
// | | | | | +=v1728
// b052 | | | +-+
// | | | +=v0018
// b010 | | +-+
// | | | | +=v0024
// b053 | | | | +-+
// | | | | | | +=v0049
// b076 | | | | | +-+
// | | | | | +=v0050
// b034 | | | | +-+
// | | | | | | +=v0051
// b077 | | | | | | +-+
// | | | | | | | +=v0052
// b054 | | | | | +-+
// | | | | | +=v0025
// b021 | | | +-+
// | | | | +=v0055
// b078 | | | | +-+
// | | | | | +=v0056
// b055 | | | | +-+
// | | | | | | +=v0057
// b079 | | | | | +-+
// | | | | | +=v0058
// b035 | | | +-+
// | | | +=v0192
// b005 | +-+
// | | +=v1664
// b036 | | +-+
// | | | | +=v0448
// b080 | | | | +-+
// | | | | | +=v0512
// b056 | | | +-+
// | | | | +=v0704
// b088 | | | | +-+
// | | | | | +=v0768
// b081 | | | +-+
// | | | +=v0640
// b022 | | +-+
// | | | | +=v0576
// b082 | | | | +-+
// | | | | | | +=v0832
// b089 | | | | | +-+
// | | | | | +=v0896
// b057 | | | | +-+
// | | | | | | +=v0960
// b090 | | | | | | +-+
// | | | | | | | +=v1024
// b083 | | | | | +-+
// | | | | | | +=v1088
// b091 | | | | | +-+
// | | | | | +=v1152
// b037 | | | +-+
// | | | | +=v1216
// b092 | | | | +-+
// | | | | | +=v1280
// b084 | | | | +-+
// | | | | | | +=v1344
// b093 | | | | | +-+
// | | | | | +=v1408
// b058 | | | +-+
// | | | +=v0256
// b011 | +-+
// | +=v0002
// b001 +-+
// | +=v0003
// b012 | +-+
// | | | +=v0128
// b023 | | +-+
// | | +=v0008
// b006 | +-+
// | | | +=v0009
// b024 | | | +-+
// | | | | | +=v0016
// b038 | | | | +-+
// | | | | +=v0017
// b013 | | +-+
// | | +=v0004
// b003 +-+
// | +=v0005
// b014 | +-+
// | | | +=v0014
// b039 | | | +-+
// | | | | +=v0015
// b025 | | +-+
// | | +=v0064
// b007 +-+
// | +=v0006
// b015 +-+
// +=v0007
// +=XXXXX
// b059 +-+
// | | +=v1792
// b096 | | +-+
// | | | | +=v1984
// b100 | | | +-+
// | | | +=v2048
// b094 | | +-+
// | | | | +=v2112
// b101 | | | | +-+
// | | | | | +=v2176
// b097 | | | +-+
// | | | | +=v2240
// b102 | | | +-+
// | | | +=v2304
// b085 | +-+
// | | +=v1856
// b098 | | +-+
// | | | +=v1920
// b095 | +-+
// | | +=v2368
// b103 | | +-+
// | | | +=v2432
// b099 | +-+
// | | +=v2496
// b104 | +-+
// | +=v2560
// b040 +-+
// | | +=v0029
// b060 | +-+
// | +=v0030
// b026 +-+
// | | +=v0045
// b061 | | +-+
// | | | +=v0046
// b041 | +-+
// | +=v0022
// b016 +-+
// | | +=v0023
// b042 | | +-+
// | | | | +=v0047
// b062 | | | +-+
// | | | +=v0048
// b027 | +-+
// | +=v0013
// b008 +-+
// | | +=v0020
// b043 | | +-+
// | | | | +=v0033
// b063 | | | +-+
// | | | +=v0034
// b028 | | +-+
// | | | | +=v0035
// b064 | | | | +-+
// | | | | | +=v0036
// b044 | | | +-+
// | | | | +=v0037
// b065 | | | +-+
// | | | +=v0038
// b017 | +-+
// | | +=v0019
// b045 | | +-+
// | | | | +=v0031
// b066 | | | +-+
// | | | +=v0032
// b029 | +-+
// | +=v0001
// b004 +-+
// | | +=v0012
// b030 | | +-+
// | | | | +=v0053
// b067 | | | | +-+
// | | | | | +=v0054
// b046 | | | +-+
// | | | +=v0026
// b018 | | +-+
// | | | | +=v0039
// b068 | | | | +-+
// | | | | | +=v0040
// b047 | | | | +-+
// | | | | | | +=v0041
// b069 | | | | | +-+
// | | | | | +=v0042
// b031 | | | +-+
// | | | | +=v0043
// b070 | | | | +-+
// | | | | | +=v0044
// b048 | | | +-+
// | | | +=v0021
// b009 | +-+
// | | +=v0028
// b049 | | +-+
// | | | | +=v0061
// b071 | | | +-+
// | | | +=v0062
// b032 | | +-+
// | | | | +=v0063
// b072 | | | | +-+
// | | | | | +=v0000
// b050 | | | +-+
// | | | | +=v0320
// b073 | | | +-+
// | | | +=v0384
// b019 | +-+
// | +=v0010
// b002 +-+
// | | +=v0011
// b020 | | +-+
// | | | | +=v0027
// b051 | | | | +-+
// | | | | | | +=v0059
// b074 | | | | | +-+
// | | | | | +=v0060
// b033 | | | +-+
// | | | | +=v1472
// b086 | | | | +-+
// | | | | | +=v1536
// b075 | | | | +-+
// | | | | | | +=v1600
// b087 | | | | | +-+
// | | | | | +=v1728
// b052 | | | +-+
// | | | +=v0018
// b010 | | +-+
// | | | | +=v0024
// b053 | | | | +-+
// | | | | | | +=v0049
// b076 | | | | | +-+
// | | | | | +=v0050
// b034 | | | | +-+
// | | | | | | +=v0051
// b077 | | | | | | +-+
// | | | | | | | +=v0052
// b054 | | | | | +-+
// | | | | | +=v0025
// b021 | | | +-+
// | | | | +=v0055
// b078 | | | | +-+
// | | | | | +=v0056
// b055 | | | | +-+
// | | | | | | +=v0057
// b079 | | | | | +-+
// | | | | | +=v0058
// b035 | | | +-+
// | | | +=v0192
// b005 | +-+
// | | +=v1664
// b036 | | +-+
// | | | | +=v0448
// b080 | | | | +-+
// | | | | | +=v0512
// b056 | | | +-+
// | | | | +=v0704
// b088 | | | | +-+
// | | | | | +=v0768
// b081 | | | +-+
// | | | +=v0640
// b022 | | +-+
// | | | | +=v0576
// b082 | | | | +-+
// | | | | | | +=v0832
// b089 | | | | | +-+
// | | | | | +=v0896
// b057 | | | | +-+
// | | | | | | +=v0960
// b090 | | | | | | +-+
// | | | | | | | +=v1024
// b083 | | | | | +-+
// | | | | | | +=v1088
// b091 | | | | | +-+
// | | | | | +=v1152
// b037 | | | +-+
// | | | | +=v1216
// b092 | | | | +-+
// | | | | | +=v1280
// b084 | | | | +-+
// | | | | | | +=v1344
// b093 | | | | | +-+
// | | | | | +=v1408
// b058 | | | +-+
// | | | +=v0256
// b011 | +-+
// | +=v0002
// b001 +-+
// | +=v0003
// b012 | +-+
// | | | +=v0128
// b023 | | +-+
// | | +=v0008
// b006 | +-+
// | | | +=v0009
// b024 | | | +-+
// | | | | | +=v0016
// b038 | | | | +-+
// | | | | +=v0017
// b013 | | +-+
// | | +=v0004
// b003 +-+
// | +=v0005
// b014 | +-+
// | | | +=v0014
// b039 | | | +-+
// | | | | +=v0015
// b025 | | +-+
// | | +=v0064
// b007 +-+
// | +=v0006
// b015 +-+
// +=v0007
var whiteDecodeTable = [...][2]int16{
0: {0, 0},
1: {2, 3},
@@ -387,215 +402,215 @@ var whiteDecodeTable = [...][2]int16{

// blackDecodeTable represents Tables 2 and 3 for a black run.
//
// +=XXXXX
// b017 +-+
// | | +=v1792
// b042 | | +-+
// | | | | +=v1984
// b063 | | | +-+
// | | | +=v2048
// b029 | | +-+
// | | | | +=v2112
// b064 | | | | +-+
// | | | | | +=v2176
// b043 | | | +-+
// | | | | +=v2240
// b065 | | | +-+
// | | | +=v2304
// b022 | +-+
// | | +=v1856
// b044 | | +-+
// | | | +=v1920
// b030 | +-+
// | | +=v2368
// b066 | | +-+
// | | | +=v2432
// b045 | +-+
// | | +=v2496
// b067 | +-+
// | +=v2560
// b013 +-+
// | | +=v0018
// b031 | | +-+
// | | | | +=v0052
// b068 | | | | +-+
// | | | | | | +=v0640
// b095 | | | | | +-+
// | | | | | +=v0704
// b046 | | | +-+
// | | | | +=v0768
// b096 | | | | +-+
// | | | | | +=v0832
// b069 | | | +-+
// | | | +=v0055
// b023 | | +-+
// | | | | +=v0056
// b070 | | | | +-+
// | | | | | | +=v1280
// b097 | | | | | +-+
// | | | | | +=v1344
// b047 | | | | +-+
// | | | | | | +=v1408
// b098 | | | | | | +-+
// | | | | | | | +=v1472
// b071 | | | | | +-+
// | | | | | +=v0059
// b032 | | | +-+
// | | | | +=v0060
// b072 | | | | +-+
// | | | | | | +=v1536
// b099 | | | | | +-+
// | | | | | +=v1600
// b048 | | | +-+
// | | | +=v0024
// b018 | +-+
// | | +=v0025
// b049 | | +-+
// | | | | +=v1664
// b100 | | | | +-+
// | | | | | +=v1728
// b073 | | | +-+
// | | | +=v0320
// b033 | | +-+
// | | | | +=v0384
// b074 | | | | +-+
// | | | | | +=v0448
// b050 | | | +-+
// | | | | +=v0512
// b101 | | | | +-+
// | | | | | +=v0576
// b075 | | | +-+
// | | | +=v0053
// b024 | +-+
// | | +=v0054
// b076 | | +-+
// | | | | +=v0896
// b102 | | | +-+
// | | | +=v0960
// b051 | | +-+
// | | | | +=v1024
// b103 | | | | +-+
// | | | | | +=v1088
// b077 | | | +-+
// | | | | +=v1152
// b104 | | | +-+
// | | | +=v1216
// b034 | +-+
// | +=v0064
// b010 +-+
// | | +=v0013
// b019 | | +-+
// | | | | +=v0023
// b052 | | | | +-+
// | | | | | | +=v0050
// b078 | | | | | +-+
// | | | | | +=v0051
// b035 | | | | +-+
// | | | | | | +=v0044
// b079 | | | | | | +-+
// | | | | | | | +=v0045
// b053 | | | | | +-+
// | | | | | | +=v0046
// b080 | | | | | +-+
// | | | | | +=v0047
// b025 | | | +-+
// | | | | +=v0057
// b081 | | | | +-+
// | | | | | +=v0058
// b054 | | | | +-+
// | | | | | | +=v0061
// b082 | | | | | +-+
// | | | | | +=v0256
// b036 | | | +-+
// | | | +=v0016
// b014 | +-+
// | | +=v0017
// b037 | | +-+
// | | | | +=v0048
// b083 | | | | +-+
// | | | | | +=v0049
// b055 | | | +-+
// | | | | +=v0062
// b084 | | | +-+
// | | | +=v0063
// b026 | | +-+
// | | | | +=v0030
// b085 | | | | +-+
// | | | | | +=v0031
// b056 | | | | +-+
// | | | | | | +=v0032
// b086 | | | | | +-+
// | | | | | +=v0033
// b038 | | | +-+
// | | | | +=v0040
// b087 | | | | +-+
// | | | | | +=v0041
// b057 | | | +-+
// | | | +=v0022
// b020 | +-+
// | +=v0014
// b008 +-+
// | | +=v0010
// b015 | | +-+
// | | | +=v0011
// b011 | +-+
// | | +=v0015
// b027 | | +-+
// | | | | +=v0128
// b088 | | | | +-+
// | | | | | +=v0192
// b058 | | | | +-+
// | | | | | | +=v0026
// b089 | | | | | +-+
// | | | | | +=v0027
// b039 | | | +-+
// | | | | +=v0028
// b090 | | | | +-+
// | | | | | +=v0029
// b059 | | | +-+
// | | | +=v0019
// b021 | | +-+
// | | | | +=v0020
// b060 | | | | +-+
// | | | | | | +=v0034
// b091 | | | | | +-+
// | | | | | +=v0035
// b040 | | | | +-+
// | | | | | | +=v0036
// b092 | | | | | | +-+
// | | | | | | | +=v0037
// b061 | | | | | +-+
// | | | | | | +=v0038
// b093 | | | | | +-+
// | | | | | +=v0039
// b028 | | | +-+
// | | | | +=v0021
// b062 | | | | +-+
// | | | | | | +=v0042
// b094 | | | | | +-+
// | | | | | +=v0043
// b041 | | | +-+
// | | | +=v0000
// b016 | +-+
// | +=v0012
// b006 +-+
// | | +=v0009
// b012 | | +-+
// | | | +=v0008
// b009 | +-+
// | +=v0007
// b004 +-+
// | | +=v0006
// b007 | +-+
// | +=v0005
// b002 +-+
// | | +=v0001
// b005 | +-+
// | +=v0004
// b001 +-+
// | +=v0003
// b003 +-+
// +=v0002
// +=XXXXX
// b017 +-+
// | | +=v1792
// b042 | | +-+
// | | | | +=v1984
// b063 | | | +-+
// | | | +=v2048
// b029 | | +-+
// | | | | +=v2112
// b064 | | | | +-+
// | | | | | +=v2176
// b043 | | | +-+
// | | | | +=v2240
// b065 | | | +-+
// | | | +=v2304
// b022 | +-+
// | | +=v1856
// b044 | | +-+
// | | | +=v1920
// b030 | +-+
// | | +=v2368
// b066 | | +-+
// | | | +=v2432
// b045 | +-+
// | | +=v2496
// b067 | +-+
// | +=v2560
// b013 +-+
// | | +=v0018
// b031 | | +-+
// | | | | +=v0052
// b068 | | | | +-+
// | | | | | | +=v0640
// b095 | | | | | +-+
// | | | | | +=v0704
// b046 | | | +-+
// | | | | +=v0768
// b096 | | | | +-+
// | | | | | +=v0832
// b069 | | | +-+
// | | | +=v0055
// b023 | | +-+
// | | | | +=v0056
// b070 | | | | +-+
// | | | | | | +=v1280
// b097 | | | | | +-+
// | | | | | +=v1344
// b047 | | | | +-+
// | | | | | | +=v1408
// b098 | | | | | | +-+
// | | | | | | | +=v1472
// b071 | | | | | +-+
// | | | | | +=v0059
// b032 | | | +-+
// | | | | +=v0060
// b072 | | | | +-+
// | | | | | | +=v1536
// b099 | | | | | +-+
// | | | | | +=v1600
// b048 | | | +-+
// | | | +=v0024
// b018 | +-+
// | | +=v0025
// b049 | | +-+
// | | | | +=v1664
// b100 | | | | +-+
// | | | | | +=v1728
// b073 | | | +-+
// | | | +=v0320
// b033 | | +-+
// | | | | +=v0384
// b074 | | | | +-+
// | | | | | +=v0448
// b050 | | | +-+
// | | | | +=v0512
// b101 | | | | +-+
// | | | | | +=v0576
// b075 | | | +-+
// | | | +=v0053
// b024 | +-+
// | | +=v0054
// b076 | | +-+
// | | | | +=v0896
// b102 | | | +-+
// | | | +=v0960
// b051 | | +-+
// | | | | +=v1024
// b103 | | | | +-+
// | | | | | +=v1088
// b077 | | | +-+
// | | | | +=v1152
// b104 | | | +-+
// | | | +=v1216
// b034 | +-+
// | +=v0064
// b010 +-+
// | | +=v0013
// b019 | | +-+
// | | | | +=v0023
// b052 | | | | +-+
// | | | | | | +=v0050
// b078 | | | | | +-+
// | | | | | +=v0051
// b035 | | | | +-+
// | | | | | | +=v0044
// b079 | | | | | | +-+
// | | | | | | | +=v0045
// b053 | | | | | +-+
// | | | | | | +=v0046
// b080 | | | | | +-+
// | | | | | +=v0047
// b025 | | | +-+
// | | | | +=v0057
// b081 | | | | +-+
// | | | | | +=v0058
// b054 | | | | +-+
// | | | | | | +=v0061
// b082 | | | | | +-+
// | | | | | +=v0256
// b036 | | | +-+
// | | | +=v0016
// b014 | +-+
// | | +=v0017
// b037 | | +-+
// | | | | +=v0048
// b083 | | | | +-+
// | | | | | +=v0049
// b055 | | | +-+
// | | | | +=v0062
// b084 | | | +-+
// | | | +=v0063
// b026 | | +-+
// | | | | +=v0030
// b085 | | | | +-+
// | | | | | +=v0031
// b056 | | | | +-+
// | | | | | | +=v0032
// b086 | | | | | +-+
// | | | | | +=v0033
// b038 | | | +-+
// | | | | +=v0040
// b087 | | | | +-+
// | | | | | +=v0041
// b057 | | | +-+
// | | | +=v0022
// b020 | +-+
// | +=v0014
// b008 +-+
// | | +=v0010
// b015 | | +-+
// | | | +=v0011
// b011 | +-+
// | | +=v0015
// b027 | | +-+
// | | | | +=v0128
// b088 | | | | +-+
// | | | | | +=v0192
// b058 | | | | +-+
// | | | | | | +=v0026
// b089 | | | | | +-+
// | | | | | +=v0027
// b039 | | | +-+
// | | | | +=v0028
// b090 | | | | +-+
// | | | | | +=v0029
// b059 | | | +-+
// | | | +=v0019
// b021 | | +-+
// | | | | +=v0020
// b060 | | | | +-+
// | | | | | | +=v0034
// b091 | | | | | +-+
// | | | | | +=v0035
// b040 | | | | +-+
// | | | | | | +=v0036
// b092 | | | | | | +-+
// | | | | | | | +=v0037
// b061 | | | | | +-+
// | | | | | | +=v0038
// b093 | | | | | +-+
// | | | | | +=v0039
// b028 | | | +-+
// | | | | +=v0021
// b062 | | | | +-+
// | | | | | | +=v0042
// b094 | | | | | +-+
// | | | | | +=v0043
// b041 | | | +-+
// | | | +=v0000
// b016 | +-+
// | +=v0012
// b006 +-+
// | | +=v0009
// b012 | | +-+
// | | | +=v0008
// b009 | +-+
// | +=v0007
// b004 +-+
// | | +=v0006
// b007 | +-+
// | +=v0005
// b002 +-+
// | | +=v0001
// b005 | +-+
// | +=v0004
// b001 +-+
// | +=v0003
// b003 +-+
// +=v0002
var blackDecodeTable = [...][2]int16{
0: {0, 0},
1: {2, 3},
@@ -718,16 +733,17 @@ type bitString struct {

// modeEncodeTable represents Table 1 and the End-of-Line code.
var modeEncodeTable = [...]bitString{
0: {0x0001, 4}, // "0001"
1: {0x0001, 3}, // "001"
2: {0x0001, 1}, // "1"
3: {0x0003, 3}, // "011"
4: {0x0003, 6}, // "000011"
5: {0x0003, 7}, // "0000011"
6: {0x0002, 3}, // "010"
7: {0x0002, 6}, // "000010"
8: {0x0002, 7}, // "0000010"
9: {0x0001, 7}, // "0000001"
0: {0x0001, 4}, // "0001"
1: {0x0001, 3}, // "001"
2: {0x0001, 1}, // "1"
3: {0x0003, 3}, // "011"
4: {0x0003, 6}, // "000011"
5: {0x0003, 7}, // "0000011"
6: {0x0002, 3}, // "010"
7: {0x0002, 6}, // "000010"
8: {0x0002, 7}, // "0000010"
9: {0x0001, 7}, // "0000001"
10: {0x0001, 12}, // "000000000001"
}

// whiteEncodeTable2 represents Table 2 for a white run.
@@ -967,6 +983,7 @@ const (
modeVL2 // Vertical-Left-2
modeVL3 // Vertical-Left-3
modeExt // Extension
modeEOL // End-of-Line
)

// COPY PASTE table.go END

+ 0
- 1
vendor/golang.org/x/image/tiff/fuzz.go View File

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

//go:build gofuzz
// +build gofuzz

package tiff


+ 3
- 3
vendor/golang.org/x/image/tiff/lzw/reader.go View File

@@ -3,8 +3,8 @@
// license that can be found in the LICENSE file.

// Package lzw implements the Lempel-Ziv-Welch compressed data format,
// described in T. A. Welch, A Technique for High-Performance Data
// Compression, Computer, 17(6) (June 1984), pp 8-19.
// described in T. A. Welch, ``A Technique for High-Performance Data
// Compression'', Computer, 17(6) (June 1984), pp 8-19.
//
// In particular, it implements LZW as used by the TIFF file format, including
// an "off by one" algorithmic difference when compared to standard LZW.
@@ -30,7 +30,7 @@ Aldus "off by one" algorithm.

The Go code doesn't read (invalid) TIFF files written by old versions of
libtiff, but the LZW algorithm in this package still differs from the one in
Go's standard package library to accommodate this "off by one" in valid TIFFs.
Go's standard package library to accomodate this "off by one" in valid TIFFs.
*/

import (


+ 0
- 3
vendor/golang.org/x/image/tiff/reader.go View File

@@ -404,9 +404,6 @@ func newDecoder(r io.Reader) (*decoder, error) {

p := make([]byte, 8)
if _, err := d.r.ReadAt(p, 0); err != nil {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
return nil, err
}
switch string(p[0:4]) {


+ 0
- 3
vendor/golang.org/x/image/tiff/writer.go View File

@@ -8,7 +8,6 @@ import (
"bytes"
"compress/zlib"
"encoding/binary"
"errors"
"image"
"io"
"sort"
@@ -339,8 +338,6 @@ func Encode(w io.Writer, m image.Image, opt *Options) error {
}
case cDeflate:
dst = zlib.NewWriter(&buf)
default:
return errors.New("tiff: unsupported compression")
}

pr := uint32(prNone)


+ 0
- 1
vendor/golang.org/x/mod/module/module.go View File

@@ -103,7 +103,6 @@ import (
"strings"
"unicode"
"unicode/utf8"
"errors"

"golang.org/x/mod/semver"
)


+ 0
- 0
vendor/golang.org/x/net/http2/server.go View File


+ 0
- 0
vendor/golang.org/x/net/http2/transport.go View File


+ 0
- 0
vendor/golang.org/x/net/idna/idna9.0.0.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/mkerrors.sh View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_darwin.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_freebsd.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_freebsd_386.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_illumos.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_linux.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_linux_386.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_linux_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_linux_arm64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_netbsd.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_openbsd.go View File


+ 0
- 277
vendor/golang.org/x/sys/unix/syscall_solaris.go View File

@@ -1119,280 +1119,3 @@ func (s *Strioctl) SetInt(i int) {
func IoctlSetStrioctlRetInt(fd int, req int, s *Strioctl) (int, error) {
return ioctlPtrRet(fd, req, unsafe.Pointer(s))
}

// Event Ports

type fileObjCookie struct {
fobj *fileObj
cookie interface{}
}

// EventPort provides a safe abstraction on top of Solaris/illumos Event Ports.
type EventPort struct {
port int
mu sync.Mutex
fds map[uintptr]*fileObjCookie
paths map[string]*fileObjCookie
// The user cookie presents an interesting challenge from a memory management perspective.
// There are two paths by which we can discover that it is no longer in use:
// 1. The user calls port_dissociate before any events fire
// 2. An event fires and we return it to the user
// The tricky situation is if the event has fired in the kernel but
// the user hasn't requested/received it yet.
// If the user wants to port_dissociate before the event has been processed,
// we should handle things gracefully. To do so, we need to keep an extra
// reference to the cookie around until the event is processed
// thus the otherwise seemingly extraneous "cookies" map
// The key of this map is a pointer to the corresponding &fCookie.cookie
cookies map[*interface{}]*fileObjCookie
}

// PortEvent is an abstraction of the port_event C struct.
// Compare Source against PORT_SOURCE_FILE or PORT_SOURCE_FD
// to see if Path or Fd was the event source. The other will be
// uninitialized.
type PortEvent struct {
Cookie interface{}
Events int32
Fd uintptr
Path string
Source uint16
fobj *fileObj
}

// NewEventPort creates a new EventPort including the
// underlying call to port_create(3c).
func NewEventPort() (*EventPort, error) {
port, err := port_create()
if err != nil {
return nil, err
}
e := &EventPort{
port: port,
fds: make(map[uintptr]*fileObjCookie),
paths: make(map[string]*fileObjCookie),
cookies: make(map[*interface{}]*fileObjCookie),
}
return e, nil
}

//sys port_create() (n int, err error)
//sys port_associate(port int, source int, object uintptr, events int, user *byte) (n int, err error)
//sys port_dissociate(port int, source int, object uintptr) (n int, err error)
//sys port_get(port int, pe *portEvent, timeout *Timespec) (n int, err error)
//sys port_getn(port int, pe *portEvent, max uint32, nget *uint32, timeout *Timespec) (n int, err error)

// Close closes the event port.
func (e *EventPort) Close() error {
e.mu.Lock()
defer e.mu.Unlock()
err := Close(e.port)
if err != nil {
return err
}
e.fds = nil
e.paths = nil
return nil
}

// PathIsWatched checks to see if path is associated with this EventPort.
func (e *EventPort) PathIsWatched(path string) bool {
e.mu.Lock()
defer e.mu.Unlock()
_, found := e.paths[path]
return found
}

// FdIsWatched checks to see if fd is associated with this EventPort.
func (e *EventPort) FdIsWatched(fd uintptr) bool {
e.mu.Lock()
defer e.mu.Unlock()
_, found := e.fds[fd]
return found
}

// AssociatePath wraps port_associate(3c) for a filesystem path including
// creating the necessary file_obj from the provided stat information.
func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, cookie interface{}) error {
e.mu.Lock()
defer e.mu.Unlock()
if _, found := e.paths[path]; found {
return fmt.Errorf("%v is already associated with this Event Port", path)
}
fobj, err := createFileObj(path, stat)
if err != nil {
return err
}
fCookie := &fileObjCookie{fobj, cookie}
_, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fobj)), events, (*byte)(unsafe.Pointer(&fCookie.cookie)))
if err != nil {
return err
}
e.paths[path] = fCookie
e.cookies[&fCookie.cookie] = fCookie
return nil
}

// DissociatePath wraps port_dissociate(3c) for a filesystem path.
func (e *EventPort) DissociatePath(path string) error {
e.mu.Lock()
defer e.mu.Unlock()
f, ok := e.paths[path]
if !ok {
return fmt.Errorf("%v is not associated with this Event Port", path)
}
_, err := port_dissociate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(f.fobj)))
// If the path is no longer associated with this event port (ENOENT)
// we should delete it from our map. We can still return ENOENT to the caller.
// But we need to save the cookie
if err != nil && err != ENOENT {
return err
}
if err == nil {
// dissociate was successful, safe to delete the cookie
fCookie := e.paths[path]
delete(e.cookies, &fCookie.cookie)
}
delete(e.paths, path)
return err
}

// AssociateFd wraps calls to port_associate(3c) on file descriptors.
func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) error {
e.mu.Lock()
defer e.mu.Unlock()
if _, found := e.fds[fd]; found {
return fmt.Errorf("%v is already associated with this Event Port", fd)
}
fCookie := &fileObjCookie{nil, cookie}
_, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(&fCookie.cookie)))
if err != nil {
return err
}
e.fds[fd] = fCookie
e.cookies[&fCookie.cookie] = fCookie
return nil
}

// DissociateFd wraps calls to port_dissociate(3c) on file descriptors.
func (e *EventPort) DissociateFd(fd uintptr) error {
e.mu.Lock()
defer e.mu.Unlock()
_, ok := e.fds[fd]
if !ok {
return fmt.Errorf("%v is not associated with this Event Port", fd)
}
_, err := port_dissociate(e.port, PORT_SOURCE_FD, fd)
if err != nil && err != ENOENT {
return err
}
if err == nil {
// dissociate was successful, safe to delete the cookie
fCookie := e.fds[fd]
delete(e.cookies, &fCookie.cookie)
}
delete(e.fds, fd)
return err
}

func createFileObj(name string, stat os.FileInfo) (*fileObj, error) {
fobj := new(fileObj)
bs, err := ByteSliceFromString(name)
if err != nil {
return nil, err
}
fobj.Name = (*int8)(unsafe.Pointer(&bs[0]))
s := stat.Sys().(*syscall.Stat_t)
fobj.Atim.Sec = s.Atim.Sec
fobj.Atim.Nsec = s.Atim.Nsec
fobj.Mtim.Sec = s.Mtim.Sec
fobj.Mtim.Nsec = s.Mtim.Nsec
fobj.Ctim.Sec = s.Ctim.Sec
fobj.Ctim.Nsec = s.Ctim.Nsec
return fobj, nil
}

// GetOne wraps port_get(3c) and returns a single PortEvent.
func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) {
pe := new(portEvent)
_, err := port_get(e.port, pe, t)
if err != nil {
return nil, err
}
p := new(PortEvent)
e.mu.Lock()
defer e.mu.Unlock()
e.peIntToExt(pe, p)
return p, nil
}

// peIntToExt converts a cgo portEvent struct into the friendlier PortEvent
// NOTE: Always call this function while holding the e.mu mutex
func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) {
peExt.Events = peInt.Events
peExt.Source = peInt.Source
cookie := (*interface{})(unsafe.Pointer(peInt.User))
peExt.Cookie = *cookie
switch peInt.Source {
case PORT_SOURCE_FD:
delete(e.cookies, cookie)
peExt.Fd = uintptr(peInt.Object)
// Only remove the fds entry if it exists and this cookie matches
if fobj, ok := e.fds[peExt.Fd]; ok {
if &fobj.cookie == cookie {
delete(e.fds, peExt.Fd)
}
}
case PORT_SOURCE_FILE:
if fCookie, ok := e.cookies[cookie]; ok && uintptr(unsafe.Pointer(fCookie.fobj)) == uintptr(peInt.Object) {
// Use our stashed reference rather than using unsafe on what we got back
// the unsafe version would be (*fileObj)(unsafe.Pointer(uintptr(peInt.Object)))
peExt.fobj = fCookie.fobj
} else {
panic("mismanaged memory")
}
delete(e.cookies, cookie)
peExt.Path = BytePtrToString((*byte)(unsafe.Pointer(peExt.fobj.Name)))
// Only remove the paths entry if it exists and this cookie matches
if fobj, ok := e.paths[peExt.Path]; ok {
if &fobj.cookie == cookie {
delete(e.paths, peExt.Path)
}
}
}
}

// Pending wraps port_getn(3c) and returns how many events are pending.
func (e *EventPort) Pending() (int, error) {
var n uint32 = 0
_, err := port_getn(e.port, nil, 0, &n, nil)
return int(n), err
}

// Get wraps port_getn(3c) and fills a slice of PortEvent.
// It will block until either min events have been received
// or the timeout has been exceeded. It will return how many
// events were actually received along with any error information.
func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error) {
if min == 0 {
return 0, fmt.Errorf("need to request at least one event or use Pending() instead")
}
if len(s) < min {
return 0, fmt.Errorf("len(s) (%d) is less than min events requested (%d)", len(s), min)
}
got := uint32(min)
max := uint32(len(s))
var err error
ps := make([]portEvent, max, max)
_, err = port_getn(e.port, &ps[0], max, &got, timeout)
// got will be trustworthy with ETIME, but not any other error.
if err != nil && err != ETIME {
return 0, err
}
e.mu.Lock()
defer e.mu.Unlock()
for i := 0; i < int(got); i++ {
e.peIntToExt(&ps[i], &s[i])
}
return int(got), err
}

+ 0
- 0
vendor/golang.org/x/sys/unix/syscall_unix.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_386.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_linux.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_386.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go View File


+ 0
- 0
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save
Baidu
map