diff --git a/src/vendor/golang.org/x/net/idna/idna10.0.0.go b/src/vendor/golang.org/x/net/idna/idna10.0.0.go index 5208ba6cb88424..229a02a62536f6 100644 --- a/src/vendor/golang.org/x/net/idna/idna10.0.0.go +++ b/src/vendor/golang.org/x/net/idna/idna10.0.0.go @@ -4,8 +4,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.10 -// +build go1.10 +//go:build go1.10 && !omitidna +// +build go1.10,!omitidna // Package idna implements IDNA2008 using the compatibility processing // defined by UTS (Unicode Technical Standard) #46, which defines a standard to diff --git a/src/vendor/golang.org/x/net/idna/omit.go b/src/vendor/golang.org/x/net/idna/omit.go new file mode 100644 index 00000000000000..ca8cbb11854bfc --- /dev/null +++ b/src/vendor/golang.org/x/net/idna/omit.go @@ -0,0 +1,33 @@ +//go:build omitidna +// +build omitidna + +package idna + +import "errors" + +var errDisabled = errors.New("idna: support for IDNA is compiled out") + +func ToASCII(s string) (string, error) { + if isASCII(s) { + return s, nil + } + return "", errDisabled +} + +func isASCII(s string) bool { + const RuneSelf = 0x80 + for i := 0; i < len(s); i++ { + if s[0] >= RuneSelf { + return false + } + } + return true +} + +var Lookup fakeProfile + +type fakeProfile struct{} + +func (fakeProfile) ToASCII(s string) (string, error) { + return ToASCII(s) +} diff --git a/src/vendor/golang.org/x/net/idna/punycode.go b/src/vendor/golang.org/x/net/idna/punycode.go index 02c7d59af3b417..f7e35b996832cb 100644 --- a/src/vendor/golang.org/x/net/idna/punycode.go +++ b/src/vendor/golang.org/x/net/idna/punycode.go @@ -1,5 +1,8 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !omitidna +// +build !omitidna + // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/src/vendor/golang.org/x/net/idna/tables10.0.0.go b/src/vendor/golang.org/x/net/idna/tables10.0.0.go index d1d62ef459bb73..8254da7f350cd5 100644 --- a/src/vendor/golang.org/x/net/idna/tables10.0.0.go +++ b/src/vendor/golang.org/x/net/idna/tables10.0.0.go @@ -1,7 +1,7 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.10 && !go1.13 -// +build go1.10,!go1.13 +//go:build go1.10 && !go1.13 && !omitidna +// +build go1.10,!go1.13,!omitidna package idna diff --git a/src/vendor/golang.org/x/net/idna/tables11.0.0.go b/src/vendor/golang.org/x/net/idna/tables11.0.0.go index 167efba71256cd..aeb27b95ad2261 100644 --- a/src/vendor/golang.org/x/net/idna/tables11.0.0.go +++ b/src/vendor/golang.org/x/net/idna/tables11.0.0.go @@ -1,7 +1,7 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.13 && !go1.14 -// +build go1.13,!go1.14 +//go:build go1.13 && !go1.14 && !omitidna +// +build go1.13,!go1.14,!omitidna package idna diff --git a/src/vendor/golang.org/x/net/idna/tables12.0.0.go b/src/vendor/golang.org/x/net/idna/tables12.0.0.go index ab40f7bcc3b812..51ab9d1198d47e 100644 --- a/src/vendor/golang.org/x/net/idna/tables12.0.0.go +++ b/src/vendor/golang.org/x/net/idna/tables12.0.0.go @@ -1,7 +1,7 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.14 && !go1.16 -// +build go1.14,!go1.16 +//go:build go1.14 && !go1.16 && !omitidna +// +build go1.14,!go1.16,!omitidna package idna diff --git a/src/vendor/golang.org/x/net/idna/tables13.0.0.go b/src/vendor/golang.org/x/net/idna/tables13.0.0.go index 390c5e56d2a4e4..e4ac831d9974b1 100644 --- a/src/vendor/golang.org/x/net/idna/tables13.0.0.go +++ b/src/vendor/golang.org/x/net/idna/tables13.0.0.go @@ -1,7 +1,7 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.16 -// +build go1.16 +//go:build go1.16 && !omitidna +// +build go1.16,!omitidna package idna diff --git a/src/vendor/golang.org/x/net/idna/tables9.0.0.go b/src/vendor/golang.org/x/net/idna/tables9.0.0.go index 4074b5332e3e34..3b2b897d403217 100644 --- a/src/vendor/golang.org/x/net/idna/tables9.0.0.go +++ b/src/vendor/golang.org/x/net/idna/tables9.0.0.go @@ -1,7 +1,7 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build !go1.10 -// +build !go1.10 +//go:build !go1.10 && !omitidna +// +build !go1.10,!omitidna package idna diff --git a/src/vendor/golang.org/x/net/idna/trie.go b/src/vendor/golang.org/x/net/idna/trie.go index c4ef847e7a37d6..2cc737175fe3e2 100644 --- a/src/vendor/golang.org/x/net/idna/trie.go +++ b/src/vendor/golang.org/x/net/idna/trie.go @@ -1,5 +1,8 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !omitidna +// +build !omitidna + // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/src/vendor/golang.org/x/net/idna/trieval.go b/src/vendor/golang.org/x/net/idna/trieval.go index 7a8cf889b5bc74..f74a75811a3775 100644 --- a/src/vendor/golang.org/x/net/idna/trieval.go +++ b/src/vendor/golang.org/x/net/idna/trieval.go @@ -1,5 +1,8 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !omitidna +// +build !omitidna + package idna // This file contains definitions for interpreting the trie value of the idna