Skip to content

Commit fd3c19f

Browse files
committed
style: format all Go source files with gofmt
1 parent 3119741 commit fd3c19f

51 files changed

Lines changed: 220 additions & 224 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/gitant/agents.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ var agentListCmd = &cobra.Command{
2323
client := cli.NewClient(daemonURL)
2424
var result struct {
2525
Agents []struct {
26-
DID string `json:"did"`
27-
TrustScore float64 `json:"trust_score"`
28-
RepoCount int `json:"repos"`
29-
CommitCount int `json:"commits"`
26+
DID string `json:"did"`
27+
TrustScore float64 `json:"trust_score"`
28+
RepoCount int `json:"repos"`
29+
CommitCount int `json:"commits"`
3030
} `json:"agents"`
3131
Total int `json:"total"`
3232
}

cmd/gitant/commands_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,3 @@ func TestUCANListRevocationsEmpty(t *testing.T) {
679679
t.Errorf("expected 'No revoked UCANs', got: %s", out)
680680
}
681681
}
682-

cmd/gitant/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ var serveCmd = &cobra.Command{
222222
sshAuthorizedKeysPath, _ := cmd.Flags().GetString("ssh-authorized-keys")
223223

224224
sshConfig := transport.SSHConfig{
225-
Port: sshPort,
226-
HostKeyPath: sshHostKeyPath,
225+
Port: sshPort,
226+
HostKeyPath: sshHostKeyPath,
227227
AuthorizedKeysPath: sshAuthorizedKeysPath,
228228
}
229229

internal/api/dto/repository.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ type Repository struct {
1111

1212
// RepositoryListResponse is the response for listing repositories.
1313
type RepositoryListResponse struct {
14-
Repos []Repository `json:"repos"`
15-
Total int `json:"total"`
16-
Offset int `json:"offset"`
17-
Limit int `json:"limit"`
14+
Repos []Repository `json:"repos"`
15+
Total int `json:"total"`
16+
Offset int `json:"offset"`
17+
Limit int `json:"limit"`
1818
}
1919

2020
// CreateRepositoryRequest is the request for creating a repository.

internal/api/handlers/agents.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import (
1717

1818
// Agent represents a known agent in the registry
1919
type Agent struct {
20-
DID string `json:"did"`
21-
FirstSeen time.Time `json:"first_seen"`
22-
LastSeen time.Time `json:"last_seen"`
23-
RepoCount int `json:"repos"`
24-
CommitCount int `json:"commits"`
25-
TrustScore float64 `json:"trust_score"`
20+
DID string `json:"did"`
21+
FirstSeen time.Time `json:"first_seen"`
22+
LastSeen time.Time `json:"last_seen"`
23+
RepoCount int `json:"repos"`
24+
CommitCount int `json:"commits"`
25+
TrustScore float64 `json:"trust_score"`
2626
}
2727

2828
// AgentRegistry tracks known agents
@@ -292,11 +292,11 @@ func DelegateCapability(id *identity.Identity) http.HandlerFunc {
292292
w.Header().Set("Content-Type", "application/json")
293293
w.WriteHeader(http.StatusCreated)
294294
json.NewEncoder(w).Encode(map[string]interface{}{
295-
"token": token,
296-
"issuer": ucan.Issuer,
295+
"token": token,
296+
"issuer": ucan.Issuer,
297297
"audience": ucan.Audience,
298-
"expires": ucan.Expires,
299-
"caps": ucan.Caps,
298+
"expires": ucan.Expires,
299+
"caps": ucan.Caps,
300300
})
301301
}
302302
}
@@ -313,8 +313,8 @@ func GenerateDID() http.HandlerFunc {
313313
w.Header().Set("Content-Type", "application/json")
314314
w.WriteHeader(http.StatusCreated)
315315
json.NewEncoder(w).Encode(map[string]interface{}{
316-
"did": id.DID,
317-
"document": id.DIDDocument(),
316+
"did": id.DID,
317+
"document": id.DIDDocument(),
318318
})
319319
}
320320
}

internal/api/handlers/auth_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
"github.com/go-chi/chi/v5"
1111
authMiddleware "github.com/lakshmanpatel/gitant/internal/api/middleware"
12-
"github.com/lakshmanpatel/gitant/internal/identity"
1312
"github.com/lakshmanpatel/gitant/internal/application/service"
13+
"github.com/lakshmanpatel/gitant/internal/identity"
1414
"github.com/lakshmanpatel/gitant/internal/infrastructure/adapters"
1515
)
1616

internal/api/handlers/commits.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ func DiffCommitAllParents(registry *storage.RepositoryRegistry) http.HandlerFunc
135135
changes := diffTrees(repo, plumbing.ZeroHash, commit.TreeHash)
136136
w.Header().Set("Content-Type", "application/json")
137137
json.NewEncoder(w).Encode(map[string]interface{}{
138-
"commit": commitHash,
139-
"parents": []map[string]interface{}{{"hash": "root", "changes": changes, "total": len(changes)}},
138+
"commit": commitHash,
139+
"parents": []map[string]interface{}{{"hash": "root", "changes": changes, "total": len(changes)}},
140140
})
141141
return
142142
}

internal/api/handlers/import.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,3 @@ func (h *ImportHandler) Import(w http.ResponseWriter, r *http.Request) {
136136
"name": repo.Name,
137137
})
138138
}
139-

internal/api/handlers/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"bytes"
55
"encoding/json"
66
"net/http"
7-
"strings"
87
"net/http/httptest"
8+
"strings"
99
"testing"
1010

1111
"github.com/go-chi/chi/v5"

internal/api/handlers/network.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ func NetworkStatus(node *network.Node) http.HandlerFunc {
1919
}
2020

2121
writeJSON(w, http.StatusOK, map[string]interface{}{
22-
"enabled": true,
23-
"peer_id": node.Host.ID().String(),
24-
"addrs": node.AdvertisedAddrs(),
25-
"peers": node.PeerCount(),
22+
"enabled": true,
23+
"peer_id": node.Host.ID().String(),
24+
"addrs": node.AdvertisedAddrs(),
25+
"peers": node.PeerCount(),
2626
"connected": node.PeerSummaries(),
2727
})
2828
}

0 commit comments

Comments
 (0)