X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2c3c9f64426e825295aeb1f4265d67429ee14cf6..bf08477c7e766c7692731c08212c8d1c3c5628ea:/sdk/go/blockdigest/blockdigest.go diff --git a/sdk/go/blockdigest/blockdigest.go b/sdk/go/blockdigest/blockdigest.go index d2f1c60ba9..b9ecc45abc 100644 --- a/sdk/go/blockdigest/blockdigest.go +++ b/sdk/go/blockdigest/blockdigest.go @@ -1,16 +1,19 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + // Stores a Block Locator Digest compactly. Can be used as a map key. package blockdigest import ( "fmt" - "log" "regexp" "strconv" "strings" ) var LocatorPattern = regexp.MustCompile( - "^[0-9a-fA-F]{32}\\+[0-9]+(\\+[A-Z][A-Za-z0-9@_-]+)*$") + "^[0-9a-fA-F]{32}\\+[0-9]+(\\+[A-Z][A-Za-z0-9@_-]*)*$") // Stores a Block Locator Digest compactly, up to 128 bits. // Can be used as a map key. @@ -58,15 +61,6 @@ func FromString(s string) (dig BlockDigest, err error) { return } -// Will fatal with the error if an error is encountered -func AssertFromString(s string) BlockDigest { - d, err := FromString(s) - if err != nil { - log.Fatalf("Error creating BlockDigest from %s: %v", s, err) - } - return d -} - func IsBlockLocator(s string) bool { return LocatorPattern.MatchString(s) }