Skip to content

Commit 4f382f6

Browse files
committed
Simpler code
Signed-off-by: David Gageot <david.gageot@docker.com>
1 parent ac768e6 commit 4f382f6

3 files changed

Lines changed: 2 additions & 71 deletions

File tree

pkg/gateway/catalog.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import (
66
"fmt"
77
"net/http"
88
"strings"
9-
10-
"github.com/docker/cagent/pkg/sync"
9+
"sync"
1110
)
1211

1312
const DockerCatalogURL = "https://desktop.docker.com/mcp/catalog/v3/catalog.yaml"
@@ -43,7 +42,7 @@ func ServerSpec(_ context.Context, serverName string) (Server, error) {
4342
}
4443

4544
// Read the MCP Catalog only once and cache the result.
46-
var readCatalogOnce = sync.OnceErr(func() (Catalog, error) {
45+
var readCatalogOnce = sync.OnceValues(func() (Catalog, error) {
4746
// Use the JSON version because it's 3x time faster to parse than YAML.
4847
url := strings.Replace(DockerCatalogURL, ".yaml", ".json", 1)
4948

pkg/sync/oncerr.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

pkg/sync/oncerr_test.go

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)