Skip to content

Minor improvements#688

Merged
majewsky merged 2 commits intomasterfrom
minor-improvements
Apr 10, 2026
Merged

Minor improvements#688
majewsky merged 2 commits intomasterfrom
minor-improvements

Conversation

@SuperSandro2000
Copy link
Copy Markdown
Member

No description provided.

@SuperSandro2000 SuperSandro2000 requested a review from a team as a code owner April 9, 2026 17:07
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/keppel/internal/api/peer 79.66% (ø)
github.com/sapcc/keppel/internal/auth 88.60% (-0.03%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/keppel/internal/api/peer/replica_sync.go 82.93% (ø) 902 748 154
github.com/sapcc/keppel/internal/auth/request.go 93.75% (-0.06%) 1056 (-11) 990 (-11) 66 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Copy link
Copy Markdown

@MarcelCoding MarcelCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find ich schick

}
fields := strings.SplitN(string(bytes), ":", 2)
if len(fields) != 2 {
userName, password, ok := strings.Cut(string(usernamePassword), ":")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, we would reject xxx:xxx:xxx, now we would just parse it as useName=xxx, password=xxx:xxx. Technically, that's a difference - is that okay for us?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is indeed an equal rewrite. strings.SplitN(input, 2) splits input = "aa:bb:cc" into output = ["aa", "bb:cc"]. The only possible output slice lengths are 1 and 2. You're thinking of just strings.Split(input).

}
fields := strings.SplitN(string(bytes), ":", 2)
if len(fields) != 2 {
userName, password, ok := strings.Cut(string(usernamePassword), ":")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is indeed an equal rewrite. strings.SplitN(input, 2) splits input = "aa:bb:cc" into output = ["aa", "bb:cc"]. The only possible output slice lengths are 1 and 2. You're thinking of just strings.Split(input).

@majewsky majewsky merged commit b26bbd9 into master Apr 10, 2026
5 of 6 checks passed
@majewsky majewsky deleted the minor-improvements branch April 10, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants