~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/gopkg.in/juju/names.v2/tag.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
        "fmt"
8
8
        "strings"
9
9
 
 
10
        "github.com/juju/errors"
10
11
        "github.com/juju/utils"
11
12
)
12
13
 
183
184
                }
184
185
                return NewCloudTag(id), nil
185
186
        case CloudCredentialTagKind:
186
 
                id = cloudCredentialTagSuffixToId(id)
 
187
                id, err = cloudCredentialTagSuffixToId(id)
 
188
                if err != nil {
 
189
                        return nil, errors.Wrap(err, invalidTagError(tag, kind))
 
190
                }
187
191
                if !IsValidCloudCredential(id) {
188
192
                        return nil, invalidTagError(tag, kind)
189
193
                }