Skip to content

Commit d8721fd

Browse files
committed
style: lint
1 parent ffffa91 commit d8721fd

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
golang 1.25.1
2-
golangci-lint 2.5.0
2+
golangci-lint 2.7.2

pkg/backend/deepgram/speech.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func HandleSpeech(c echo.Context, options mo.Option[types.SpeechRequestOptions])
4545
}
4646

4747
auth := c.Request().Header.Get("Authorization")
48-
if strings.HasPrefix(auth, "Bearer ") {
49-
auth = "Token " + strings.TrimPrefix(auth, "Bearer ")
48+
if after, ok := strings.CutPrefix(auth, "Bearer "); ok {
49+
auth = "Token " + after
5050
}
5151

5252
req.Header.Set("Authorization", auth)

pkg/backend/deepgram/voices.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ type DeepgramModelsResponse struct {
3838
func HandleVoices(c echo.Context, options mo.Option[types.VoicesRequestOptions]) mo.Result[any] {
3939
// Deepgram requires authentication to list models
4040
auth := c.Request().Header.Get("Authorization")
41-
if strings.HasPrefix(auth, "Bearer ") {
42-
auth = "Token " + strings.TrimPrefix(auth, "Bearer ")
41+
if after, ok := strings.CutPrefix(auth, "Bearer "); ok {
42+
auth = "Token " + after
4343
}
4444

4545
req, err := http.NewRequestWithContext(

pkg/utils/jsonpatch/jsonpatch_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestJSONPatchReplace(t *testing.T) {
1515
))
1616
require.NoError(t, err)
1717

18-
patched, err := patch.Apply(lo.Must(json.Marshal(map[string]interface{}{
18+
patched, err := patch.Apply(lo.Must(json.Marshal(map[string]any{
1919
"model": "gpt-3.5",
2020
})))
2121
require.NoError(t, err)
@@ -31,7 +31,7 @@ func TestJSONPatchAdd(t *testing.T) {
3131
))
3232
require.NoError(t, err)
3333

34-
patched, err := patch.Apply(lo.Must(json.Marshal(map[string]interface{}{
34+
patched, err := patch.Apply(lo.Must(json.Marshal(map[string]any{
3535
"model": "gpt-3.5",
3636
})))
3737
require.NoError(t, err)
@@ -45,7 +45,7 @@ func TestJSONPatchRemove(t *testing.T) {
4545
))
4646
require.NoError(t, err)
4747

48-
patched, err := patch.Apply(lo.Must(json.Marshal(map[string]interface{}{
48+
patched, err := patch.Apply(lo.Must(json.Marshal(map[string]any{
4949
"model": "gpt-3.5",
5050
})))
5151
require.NoError(t, err)

0 commit comments

Comments
 (0)