mirror of
https://github.com/restic/restic.git
synced 2025-10-27 05:20:37 +00:00
Update dependencies
This commit is contained in:
2
vendor/cloud.google.com/go/internal/kokoro/build.sh
generated
vendored
2
vendor/cloud.google.com/go/internal/kokoro/build.sh
generated
vendored
@@ -38,7 +38,7 @@ go get -v ./...
|
||||
# cd $GOCLOUD_HOME
|
||||
|
||||
# Run tests and tee output to log file, to be pushed to GCS as artifact.
|
||||
go test -race -v -short ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_REVISION.log
|
||||
go test -race -v -short ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
|
||||
|
||||
# Make sure README.md is up to date.
|
||||
make -C internal/readme test diff
|
||||
|
||||
14
vendor/cloud.google.com/go/internal/optional/optional.go
generated
vendored
14
vendor/cloud.google.com/go/internal/optional/optional.go
generated
vendored
@@ -20,6 +20,7 @@ package optional
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -37,6 +38,9 @@ type (
|
||||
|
||||
// Float64 is either a float64 or nil.
|
||||
Float64 interface{}
|
||||
|
||||
// Duration is either a time.Duration or nil.
|
||||
Duration interface{}
|
||||
)
|
||||
|
||||
// ToBool returns its argument as a bool.
|
||||
@@ -89,6 +93,16 @@ func ToFloat64(v Float64) float64 {
|
||||
return x
|
||||
}
|
||||
|
||||
// ToDuration returns its argument as a time.Duration.
|
||||
// It panics if its argument is nil or not a time.Duration.
|
||||
func ToDuration(v Duration) time.Duration {
|
||||
x, ok := v.(time.Duration)
|
||||
if !ok {
|
||||
doPanic("Duration", v)
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func doPanic(capType string, v interface{}) {
|
||||
panic(fmt.Sprintf("optional.%s value should be %s, got %T", capType, strings.ToLower(capType), v))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user