Update vendor/

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2020-05-14 19:47:23 +02:00
commit cdb9e7d2b8
No known key found for this signature in database
GPG key ID: C646B23C9E3245F1
527 changed files with 113006 additions and 150362 deletions

View file

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.6.0] - 2020-02-24
### Changed
- Drop library dependency on `golang.org/x/{lint, tools}`.
## [1.5.1] - 2019-11-19
- Fix bug where `Bool.CAS` and `Bool.Toggle` do work correctly together
causing `CAS` to fail even though the old value matches.
@ -48,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release.
[1.6.0]: https://github.com/uber-go/atomic/compare/v1.5.1...v1.6.0
[1.5.1]: https://github.com/uber-go/atomic/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/uber-go/atomic/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/uber-go/atomic/compare/v1.3.2...v1.4.0

28
vendor/go.uber.org/atomic/tools.go generated vendored
View file

@ -1,28 +0,0 @@
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// +build tools
package atomic
import (
// Tools used during development.
_ "golang.org/x/lint/golint"
)

View file

@ -1,6 +1,12 @@
Releases
========
v1.5.0 (2020-02-24)
===================
- Drop library dependency on development-time tooling.
v1.4.0 (2019-11-04)
===================

View file

@ -130,7 +130,7 @@ type errorGroup interface {
}
// Errors returns a slice containing zero or more errors that the supplied
// error is composed of. If the error is nil, the returned slice is empty.
// error is composed of. If the error is nil, a nil slice is returned.
//
// err := multierr.Append(r.Close(), w.Close())
// errors := multierr.Errors(err)

2
vendor/go.uber.org/multierr/go.mod generated vendored
View file

@ -4,7 +4,7 @@ go 1.12
require (
github.com/stretchr/testify v1.3.0
go.uber.org/atomic v1.5.0
go.uber.org/atomic v1.6.0
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee
golang.org/x/lint v0.0.0-20190930215403-16217165b5de
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 // indirect

4
vendor/go.uber.org/multierr/go.sum generated vendored
View file

@ -15,8 +15,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

30
vendor/go.uber.org/multierr/tools.go generated vendored
View file

@ -1,30 +0,0 @@
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// +build tools
package multierr
import (
// Tools we use during development.
_ "go.uber.org/tools/update-license"
_ "golang.org/x/lint/golint"
_ "honnef.co/go/tools/cmd/staticcheck"
)

19
vendor/go.uber.org/tools/LICENSE generated vendored
View file

@ -1,19 +0,0 @@
Copyright (c) 2017 Uber Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -1 +0,0 @@
update-license

View file

@ -1,24 +0,0 @@
# update-license
This is a small tool that updates the license header for Uber's open source Golang files.
## Installation
```
go get go.uber.org/tools/update-license
```
## Usage
```
update-license go_files...
```
## Further Work
* Support more licenses by name (MIT, Apache 2.0, etc), file path, url (http GET)
* Support custom owner (not just "Uber Technologies, Inc.")
* Support more languages than go (cover go, java, js, py to start, along with LICENSE, LICENSE.txt)
* Talk about removing custom logic for header comments (ie `@generated`, `Code generated by`), it probably makes more sense just to put the license at the top
* Better detection support for existing licenses so they can be removed
* Verbose, dry run support

View file

@ -1,56 +0,0 @@
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package main
var licenseTemplates = map[string]string{
"Apache-2.0": `// Copyright {{.Year}} {{.Owner}}
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.`,
"MIT": `// Copyright (c) {{.Year}} {{.Owner}}
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.`,
}

View file

@ -1,228 +0,0 @@
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package main
import (
"bytes"
"flag"
"fmt"
"html/template"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"
"strings"
"time"
)
const (
// how many lines to check for an existing copyright
// this logic is not great and we should probably do something else
// but this was copied from the python script
copyrightLineLimit = 5
headerPrefix = "// Copyright"
)
var (
flagDryRun = flag.Bool("dry", false, "Do not edit files and just print out what files would be edited")
flagOwner = flag.String("owner", "Uber Technologies, Inc.", "Copyright owner")
flagLicense = flag.String(
"license",
"MIT",
fmt.Sprintf(
"Type of license to use [%s]",
strings.Join(validLicenses(), ", "),
),
)
lineSkipPrefixes = []string{
"// Code generated by",
"// @generated",
}
)
func main() {
log.SetFlags(0)
log.SetOutput(os.Stdout)
log.SetPrefix("")
if err := do(); err != nil {
log.Fatal(err)
}
}
func do() error {
flag.Parse()
if len(flag.Args()) < 1 {
return fmt.Errorf("usage: %s GO_FILES", os.Args[0])
}
return updateFiles(
flag.Args(),
time.Now().UTC().Year(),
*flagLicense,
*flagOwner,
*flagDryRun,
)
}
func fullLicense(ts string, year int, owner string) string {
var buf bytes.Buffer
t, err := template.New("").Parse(ts)
if err != nil {
log.Panic("failed to parse license template", err)
}
data := struct {
Year int
Owner string
}{year, owner}
if err := t.Execute(&buf, data); err != nil {
log.Panic("failed to execture license template", err)
}
return strings.TrimSpace(buf.String())
}
// validLicenses grabs all the license templates from the folder
func validLicenses() []string {
res := make([]string, 0, len(licenseTemplates))
for k := range licenseTemplates {
res = append(res, k)
}
sort.Strings(res)
return res
}
func updateFiles(
filePaths []string,
year int,
license string,
owner string,
dryRun bool,
) error {
if err := checkFilePaths(filePaths); err != nil {
return err
}
for _, filePath := range filePaths {
if err := updateFile(filePath, year, license, owner, dryRun); err != nil {
return err
}
}
return nil
}
func checkFilePaths(filePaths []string) error {
for _, filePath := range filePaths {
if filepath.Ext(filePath) != ".go" {
return fmt.Errorf("%s is not a go file", filePath)
}
}
return nil
}
func updateFile(
filePath string,
year int,
license string,
owner string,
dryRun bool,
) error {
data, err := ioutil.ReadFile(filePath)
if err != nil {
return err
}
newData := updateData(data, year, license, owner)
if !bytes.Equal(data, newData) {
if dryRun {
log.Print(filePath)
return nil
}
// we could do something more complicated so that we do not
// need to pass 0644 as the file mode, but in this case it should
// never actually be used to create a file since we know the file
// already exists, and it's easier to use the ReadFile/WriteFile
// logic as it is right now, and since this is just a generation
// program, this should be acceptable
return ioutil.WriteFile(filePath, newData, 0644)
}
return nil
}
func updateData(
data []byte,
year int,
license string,
owner string,
) []byte {
licenseText := fullLicense(string(licenseTemplates[license]), year, owner)
return []byte(
strings.Join(
updateLines(strings.Split(string(data), "\n"), licenseText),
"\n",
),
)
}
// a value in the returned slice may contain newlines itself
func updateLines(lines []string, license string) []string {
for i, line := range lines {
if i >= copyrightLineLimit {
break
}
if strings.HasPrefix(line, headerPrefix) {
// assume that the new license text always starts with the copyright
// string. Pretty safe to assume, right? RIGHT?
lines[i] = strings.Split(license, "\n")[0]
return lines
}
}
return addToLines(lines, license)
}
// a value in the returned slice may contain newlines itself
func addToLines(lines []string, license string) []string {
i := 0
for len(lines) > i && lineContainsSkipPrefix(lines[i]) {
i++
// skip comments under the generated line too
for strings.HasPrefix(lines[i], "//") {
i++
}
}
if i == 0 {
return append([]string{license, ""}, lines...)
}
return append(lines[0:i], append([]string{"", license}, lines[i:]...)...)
}
func lineContainsSkipPrefix(line string) bool {
for _, skipPrefix := range lineSkipPrefixes {
if strings.HasPrefix(line, skipPrefix) {
return true
}
}
return false
}