Files
android_development/tools/repo_diff/service/repodiff/repositories/common.go
Scott Lobdell f7f3db493c Dockerize for deployment
Test: Still in bootstrapping phase; tested a deployment from local
machine, can hit public facing endpoint

Change-Id: Ie194ec7e61a2ef84a3b74a22a52348a81a753d89
2018-04-02 14:48:56 -07:00

25 lines
506 B
Go

package repositories
import (
e "repodiff/entities"
"strings"
)
func cleanedDiffTarget(target e.DiffTarget) e.DiffTarget {
return e.DiffTarget{
Upstream: e.Project{
URL: protocolStrippedURL(target.Upstream.URL),
Branch: target.Upstream.Branch,
},
Downstream: e.Project{
URL: protocolStrippedURL(target.Downstream.URL),
Branch: target.Downstream.Branch,
},
}
}
func protocolStrippedURL(url string) string {
startIndex := strings.Index(url, "//")
return url[startIndex:]
}