Skip to content

Agent Mesh

fix linter

Antonio Ojead496397530bd
diff --git a/cmd/sam-agent/call.go b/cmd/sam-agent/call.go
index e674e88c..62022a14 100644
--- a/cmd/sam-agent/call.go
+++ b/cmd/sam-agent/call.go
@@ -17,6 +17,7 @@ package main
import (
"context"
"encoding/json"
+ "errors"
"fmt"
"os"
"strings"
@@ -178,13 +179,13 @@ func loadLocalIdentityAuth() (string, error) {
return "", fmt.Errorf("loading credentials: %w", err)
}
if creds == nil {
- return "", fmt.Errorf(loginHint)
+ return "", errors.New(loginHint)
}
pass := strings.TrimSpace(creds.PassportBiscuit)
if pass != "" {
return pass, nil
}
- return "", fmt.Errorf(loginHint)
+ return "", errors.New(loginHint)
}
func buildCallRequest(message string) (json.RawMessage, error) {
diff --git a/cmd/sam-agent/proxy.go b/cmd/sam-agent/proxy.go
index 1645854d..3af8f357 100644
--- a/cmd/sam-agent/proxy.go
+++ b/cmd/sam-agent/proxy.go
@@ -17,6 +17,7 @@ package main
import (
"context"
"encoding/json"
+ "errors"
"fmt"
"io"
"log/slog"
@@ -228,7 +229,7 @@ func extractBearerToken(header string) (string, error) {
}
parts := strings.SplitN(header, " ", 2)
if len(parts) != 2 || !strings.EqualFold(strings.TrimSpace(parts[0]), "Bearer") {
- return "", fmt.Errorf("Authorization must use Bearer scheme")
+ return "", errors.New("authorization must use Bearer scheme")
}
token := strings.TrimSpace(parts[1])
if token == "" {
diff --git a/pkg/protocol/http_tunnel.go b/pkg/protocol/http_tunnel.go
index 94468c98..a2bb5d23 100644
--- a/pkg/protocol/http_tunnel.go
+++ b/pkg/protocol/http_tunnel.go
@@ -18,6 +18,7 @@ import (
"bufio"
"context"
"encoding/json"
+ "errors"
"fmt"
"io"
"net/http"
@@ -212,7 +213,7 @@ func extractBearerFromValues(values []string) (string, error) {
if len(values) == 0 {
return "", fmt.Errorf("missing Authorization header")
}
- return "", fmt.Errorf("Authorization must use Bearer scheme")
+ return "", errors.New("authorization must use Bearer scheme")
}
func (s *HTTPTunnelService) forwardLocal(ctx context.Context, treq HTTPTunnelRequest) HTTPTunnelResponse {