Merge pull request #197 from Quasilyte/patch-1

remove excessive type assertions
This commit is contained in:
Eddie Zaneski 2019-02-02 08:59:01 -07:00 committed by GitHub
commit a6c3fdbc76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -258,11 +258,11 @@ func (p *ProjectsServiceOp) AssignResources(ctx context.Context, projectID strin
}
for i, resource := range resources {
switch resource.(type) {
switch resource := resource.(type) {
case ResourceWithURN:
ar.Resources[i] = resource.(ResourceWithURN).URN()
ar.Resources[i] = resource.URN()
case string:
ar.Resources[i] = resource.(string)
ar.Resources[i] = resource
default:
return nil, nil, fmt.Errorf("%T must either be a string or have a valid URN method", resource)
}