Skip to content

Commit 192a7ba

Browse files
modernize codebase (#83)
1 parent a6092e5 commit 192a7ba

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

pkg/actions/interactive/states/common.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,3 @@ func footerView(info string, width int) string {
5454
line := strings.Repeat("─", max(0, width-lipgloss.Width(infoStyle)-4))
5555
return lipgloss.JoinHorizontal(lipgloss.Center, BasicColorStyle.Render(line), infoStyle)
5656
}
57-
58-
func max(a, b int) int {
59-
if a > b {
60-
return a
61-
}
62-
return b
63-
}

pkg/utils/tokengen.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func buildPQToken(sk *mldsa.PrivateKey, username, machineName string) (string, e
7878
}
7979

8080
now := time.Now()
81-
payload := map[string]interface{}{
81+
payload := map[string]any{
8282
"iss": "github.com/therealpaulgg/ssh-sync",
8383
"iat": now.Add(-1 * time.Minute).Unix(),
8484
"exp": now.Add(2 * time.Minute).Unix(),
@@ -102,4 +102,3 @@ func buildPQToken(sk *mldsa.PrivateKey, username, machineName string) (string, e
102102

103103
return signingInput + "." + b64Sig, nil
104104
}
105-

pkg/utils/tokengen_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func generateTestSigningKey(t *testing.T) *mldsa.PrivateKey {
2424
return sk
2525
}
2626

27-
func decodeTokenParts(t *testing.T, token string) (header, payload map[string]interface{}, sigBytes []byte) {
27+
func decodeTokenParts(t *testing.T, token string) (header, payload map[string]any, sigBytes []byte) {
2828
t.Helper()
2929
parts := strings.SplitN(token, ".", 3)
3030
require.Len(t, parts, 3, "JWT must have three dot-separated parts")

0 commit comments

Comments
 (0)