Idiomatic style would be to check right away:

```go
if !success {
  return errors.New("register failed")
}
```

and then outdent the success path below the check.