diff options
| author | Fijxu <fijxu@nadeko.net> | 2025-03-30 00:12:19 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-29 23:12:19 -0400 |
| commit | 052316ba25c86d5dcc870cd5b4c045ea67110562 (patch) | |
| tree | 1b104e20c6aafa7cb154dec42ee3a2fdd7e6d3fc /cmd | |
| parent | db5143ae7a53eb54fadeb2166252e1a7de5450b9 (diff) | |
| download | anubis-052316ba25c86d5dcc870cd5b4c045ea67110562.tar.xz anubis-052316ba25c86d5dcc870cd5b4c045ea67110562.zip | |
cmd/containerbuild: use TrimSuffix instead of TrimRight (#157)
Using TrimRight will remove all characters from `*dockerRepo` from right
to left that match a character contained on `"/"+filepath.Base(*dockerRepo)`
(the cutset) until it doesn't matches anymore.
So for example, if `dockerRepo` is `example.com/fijxu/anubis`, and
`"/"+filepath.Base(*dockerRepo)` is `/anubis`, it will remove
`u/anubis` and not just `/anubis` from `dockerRepo` because `u` is a character inside the
cutoff.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/containerbuild/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/containerbuild/main.go b/cmd/containerbuild/main.go index 18e879c..8d34a3a 100644 --- a/cmd/containerbuild/main.go +++ b/cmd/containerbuild/main.go @@ -30,7 +30,7 @@ func main() { internal.InitSlog(*slogLevel) - koDockerRepo := strings.TrimRight(*dockerRepo, "/"+filepath.Base(*dockerRepo)) + koDockerRepo := strings.TrimSuffix(*dockerRepo, "/"+filepath.Base(*dockerRepo)) if *githubEventName == "pull_request" && *pullRequestID != -1 { *dockerRepo = fmt.Sprintf("ttl.sh/techaro/pr-%d/anubis", *pullRequestID) |
