Skip to content

Commit

Permalink
tweaks string processing in dependencymapper
Browse files Browse the repository at this point in the history
Signed-off-by: Forest Eckhardt <feckhardt@pivotal.io>
  • Loading branch information
Frankie Gallina-Jones authored and ForestEckhardt committed Feb 24, 2021
1 parent 7900ecf commit d6bbe27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions postal/internal/dependency_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (d DependencyMappingResolver) FindDependencyMapping(sha256, bindingPath str
return "", fmt.Errorf("couldn't read binding type: %w", err)
}

if strings.Contains(string(bindType), "dependency-mapping") {
if strings.TrimSpace(string(bindType)) == "dependency-mapping" {
if _, err := os.Stat(filepath.Join(binding, sha256)); err != nil {
if !os.IsNotExist(err) {
return "", err
Expand All @@ -46,7 +46,7 @@ func (d DependencyMappingResolver) FindDependencyMapping(sha256, bindingPath str
if err != nil {
return "", err
}
return strings.TrimSuffix(string(uri), "\n"), nil
return strings.TrimSpace(string(uri)), nil
}
}
return "", nil
Expand Down

0 comments on commit d6bbe27

Please sign in to comment.