macaroons test: fix formatting

This commit is contained in:
Johan T. Halseth 2020-09-24 11:59:08 +02:00
parent 14960b1fb4
commit 65865030d6
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -19,8 +19,9 @@ var (
)
func createDummyMacaroon(t *testing.T) *macaroon.Macaroon {
dummyMacaroon, err := macaroon.New(testRootKey, testID,
testLocation, testVersion)
dummyMacaroon, err := macaroon.New(
testRootKey, testID, testLocation, testVersion,
)
if err != nil {
t.Fatalf("Error creating initial macaroon: %v", err)
}
@ -36,8 +37,9 @@ func TestAddConstraints(t *testing.T) {
// Now add a constraint and make sure we have a cloned macaroon
// with the constraint applied instead of a mutated initial one.
newMac, err := macaroons.AddConstraints(initialMac,
macaroons.TimeoutConstraint(1))
newMac, err := macaroons.AddConstraints(
initialMac, macaroons.TimeoutConstraint(1),
)
if err != nil {
t.Fatalf("Error adding constraint: %v", err)
}
@ -69,8 +71,10 @@ func TestTimeoutConstraint(t *testing.T) {
// Finally, check that the created caveat has an
// acceptable value.
if !strings.HasPrefix(string(testMacaroon.Caveats()[0].Id),
expectedTimeCaveatSubstring) {
if !strings.HasPrefix(
string(testMacaroon.Caveats()[0].Id),
expectedTimeCaveatSubstring,
) {
t.Fatalf("Added caveat '%s' does not meet the expectations!",
testMacaroon.Caveats()[0].Id)
}