interface{} -> any

This commit is contained in:
Evan Jarrett
2026-01-04 21:10:29 -06:00
parent aa4b32bbd6
commit a7175f9e3e
13 changed files with 32 additions and 32 deletions
@@ -35,7 +35,7 @@ type ProviderRequest struct {
// ProviderResponse is the response format to Gatekeeper.
type ProviderResponse struct {
SystemError string `json:"system_error,omitempty"`
Responses []map[string]interface{} `json:"responses"`
Responses []map[string]any `json:"responses"`
}
// VerificationResult holds the result of verifying a single image.
@@ -110,7 +110,7 @@ func (s *Server) handleProvide(w http.ResponseWriter, r *http.Request) {
log.Printf("INFO: received verification request for %d images", len(req.Values))
// Verify each image
responses := make([]map[string]interface{}, 0, len(req.Values))
responses := make([]map[string]any, 0, len(req.Values))
for _, image := range req.Values {
result := s.verifyImage(r.Context(), image)
responses = append(responses, structToMap(result))
@@ -186,9 +186,9 @@ func (s *Server) handleReady(w http.ResponseWriter, r *http.Request) {
}
// structToMap converts a struct to a map for JSON encoding.
func structToMap(v interface{}) map[string]interface{} {
func structToMap(v any) map[string]any {
data, _ := json.Marshal(v)
var m map[string]interface{}
var m map[string]any
json.Unmarshal(data, &m)
return m
}
+1 -1
View File
@@ -196,7 +196,7 @@ type VerifierResult struct {
Name string
Type string
Message string
Extensions map[string]interface{}
Extensions map[string]any
}
```
@@ -166,7 +166,7 @@ func (v *ATProtoVerifier) VerifyReference(
Name: v.name,
Type: v.Type(),
Message: fmt.Sprintf("Successfully verified ATProto signature for DID %s", sigData.ATProto.DID),
Extensions: map[string]interface{}{
Extensions: map[string]any{
"did": sigData.ATProto.DID,
"handle": sigData.ATProto.Handle,
"signedAt": sigData.ATProto.SignedAt,
@@ -203,7 +203,7 @@ func (v *ATProtoVerifier) failureResult(message string) verifier.VerifierResult
Name: v.name,
Type: v.Type(),
Message: message,
Extensions: map[string]interface{}{
Extensions: map[string]any{
"error": message,
},
}