Skip to content

Commit deb91db

Browse files
committed
chore: bump deps
1 parent 09370f8 commit deb91db

14 files changed

Lines changed: 70 additions & 57 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/sammcj/mcp-devtools
22

3-
go 1.26.1
3+
go 1.26.2
44

55
require (
66
github.com/JohannesKaufmann/html-to-markdown/v2 v2.5.0

internal/handlers/github_actions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (h *GitHubActionsHandler) GetLatestVersion(ctx context.Context, args map[st
6868
continue
6969
}
7070
if version, ok := actionMap["currentVersion"].(string); ok {
71-
action.CurrentVersion = StringPtr(version)
71+
action.CurrentVersion = new(version)
7272
}
7373
actions = append(actions, action)
7474
}
@@ -118,8 +118,8 @@ func (h *GitHubActionsHandler) GetLatestVersion(ctx context.Context, args map[st
118118

119119
// Add details if requested
120120
if includeDetails {
121-
result.PublishedAt = StringPtr(publishedAt)
122-
result.URL = StringPtr(url)
121+
result.PublishedAt = new(publishedAt)
122+
result.URL = new(url)
123123
}
124124

125125
results = append(results, result)

internal/handlers/go.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (h *GoHandler) GetLatestVersion(ctx context.Context, args map[string]any) (
188188
if isReplaced {
189189
results = append(results, PackageVersion{
190190
Name: req.Path,
191-
CurrentVersion: StringPtr(req.Version),
191+
CurrentVersion: new(req.Version),
192192
LatestVersion: fmt.Sprintf("replaced by %s@%s", replacedBy, replacedVersion),
193193
Registry: "go",
194194
Skipped: true,
@@ -206,7 +206,7 @@ func (h *GoHandler) GetLatestVersion(ctx context.Context, args map[string]any) (
206206
}).Error("Failed to get Go module info")
207207
results = append(results, PackageVersion{
208208
Name: req.Path,
209-
CurrentVersion: StringPtr(req.Version),
209+
CurrentVersion: new(req.Version),
210210
LatestVersion: "unknown",
211211
Registry: "go",
212212
Skipped: true,
@@ -218,7 +218,7 @@ func (h *GoHandler) GetLatestVersion(ctx context.Context, args map[string]any) (
218218
// Add result
219219
results = append(results, PackageVersion{
220220
Name: req.Path,
221-
CurrentVersion: StringPtr(req.Version),
221+
CurrentVersion: new(req.Version),
222222
LatestVersion: latestVersion,
223223
Registry: "go",
224224
})

internal/handlers/java.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (h *JavaHandler) GetLatestVersionFromMaven(ctx context.Context, args map[st
154154
}).Error("Failed to get Maven artifact info")
155155
results = append(results, PackageVersion{
156156
Name: fmt.Sprintf("%s:%s", dep.GroupID, dep.ArtifactID),
157-
CurrentVersion: StringPtr(dep.Version),
157+
CurrentVersion: new(dep.Version),
158158
LatestVersion: "unknown",
159159
Registry: "maven",
160160
Skipped: true,
@@ -170,7 +170,7 @@ func (h *JavaHandler) GetLatestVersionFromMaven(ctx context.Context, args map[st
170170
}
171171
results = append(results, PackageVersion{
172172
Name: name,
173-
CurrentVersion: StringPtr(dep.Version),
173+
CurrentVersion: new(dep.Version),
174174
LatestVersion: latestVersion,
175175
Registry: "maven",
176176
})
@@ -245,7 +245,7 @@ func (h *JavaHandler) GetLatestVersionFromGradle(ctx context.Context, args map[s
245245
}).Error("Failed to get Maven artifact info")
246246
results = append(results, PackageVersion{
247247
Name: fmt.Sprintf("%s:%s", dep.Group, dep.Name),
248-
CurrentVersion: StringPtr(dep.Version),
248+
CurrentVersion: new(dep.Version),
249249
LatestVersion: "unknown",
250250
Registry: "gradle",
251251
Skipped: true,
@@ -261,7 +261,7 @@ func (h *JavaHandler) GetLatestVersionFromGradle(ctx context.Context, args map[s
261261
}
262262
results = append(results, PackageVersion{
263263
Name: name,
264-
CurrentVersion: StringPtr(dep.Version),
264+
CurrentVersion: new(dep.Version),
265265
LatestVersion: latestVersion,
266266
Registry: "gradle",
267267
})

internal/handlers/npm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (h *NpmHandler) GetLatestVersion(ctx context.Context, args map[string]any)
154154
}).Error("Failed to get npm package info")
155155
results = append(results, PackageVersion{
156156
Name: name,
157-
CurrentVersion: StringPtr(currentVersion),
157+
CurrentVersion: new(currentVersion),
158158
LatestVersion: "unknown",
159159
Registry: "npm",
160160
Skipped: true,
@@ -200,7 +200,7 @@ func (h *NpmHandler) GetLatestVersion(ctx context.Context, args map[string]any)
200200
// Add result
201201
results = append(results, PackageVersion{
202202
Name: name,
203-
CurrentVersion: StringPtr(currentVersion),
203+
CurrentVersion: new(currentVersion),
204204
LatestVersion: latestVersion,
205205
Registry: "npm",
206206
})

internal/handlers/python.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (h *PythonHandler) GetLatestVersionFromRequirements(ctx context.Context, ar
158158
}).Error("Failed to get PyPI package info")
159159
results = append(results, PackageVersion{
160160
Name: name,
161-
CurrentVersion: StringPtr(currentVersion),
161+
CurrentVersion: new(currentVersion),
162162
LatestVersion: "unknown",
163163
Registry: "pypi",
164164
Skipped: true,
@@ -173,7 +173,7 @@ func (h *PythonHandler) GetLatestVersionFromRequirements(ctx context.Context, ar
173173
// Add result
174174
results = append(results, PackageVersion{
175175
Name: name,
176-
CurrentVersion: StringPtr(currentVersion),
176+
CurrentVersion: new(currentVersion),
177177
LatestVersion: latestVersion,
178178
Registry: "pypi",
179179
})
@@ -311,7 +311,7 @@ func (h *PythonHandler) processPackage(name, version string) (PackageVersion, er
311311
if err != nil {
312312
return PackageVersion{
313313
Name: name,
314-
CurrentVersion: StringPtr(currentVersion),
314+
CurrentVersion: new(currentVersion),
315315
LatestVersion: "unknown",
316316
Registry: "pypi",
317317
Skipped: true,
@@ -324,7 +324,7 @@ func (h *PythonHandler) processPackage(name, version string) (PackageVersion, er
324324

325325
return PackageVersion{
326326
Name: name,
327-
CurrentVersion: StringPtr(currentVersion),
327+
CurrentVersion: new(currentVersion),
328328
LatestVersion: latestVersion,
329329
Registry: "pypi",
330330
}, nil

internal/handlers/swift.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (h *SwiftHandler) GetLatestVersion(ctx context.Context, args map[string]any
122122
}).Error("Failed to get Swift package info")
123123
results = append(results, PackageVersion{
124124
Name: dep.URL,
125-
CurrentVersion: StringPtr(dep.Version),
125+
CurrentVersion: new(dep.Version),
126126
LatestVersion: "unknown",
127127
Registry: "swift",
128128
Skipped: true,
@@ -153,7 +153,7 @@ func (h *SwiftHandler) GetLatestVersion(ctx context.Context, args map[string]any
153153
// Add result
154154
results = append(results, PackageVersion{
155155
Name: dep.URL,
156-
CurrentVersion: StringPtr(dep.Version),
156+
CurrentVersion: new(dep.Version),
157157
LatestVersion: latestVersion,
158158
Registry: "swift",
159159
})

internal/handlers/utils.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,17 @@ func CleanVersion(version string) string {
227227
}
228228

229229
// StringPtr returns a pointer to the given string
230+
//
231+
//go:fix inline
230232
func StringPtr(s string) *string {
231-
return &s
233+
return new(s)
232234
}
233235

234236
// IntPtr returns a pointer to the given int
237+
//
238+
//go:fix inline
235239
func IntPtr(i int) *int {
236-
return &i
240+
return new(i)
237241
}
238242

239243
// ExtractMajorVersion extracts the major version from a version string

internal/tools/packageversions/githubactions/github_actions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ func (t *GitHubActionsTool) getLatestVersions(logger *logrus.Logger, cache *sync
159159

160160
// Add details if requested
161161
if includeDetails {
162-
result.PublishedAt = packageversions.StringPtr(publishedAt)
163-
result.URL = packageversions.StringPtr(url)
162+
result.PublishedAt = new(publishedAt)
163+
result.URL = new(url)
164164
}
165165

166166
// Cache result

internal/tools/packageversions/rust/rust.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,33 +148,33 @@ func (t *RustTool) Execute(ctx context.Context, logger *logrus.Logger, cache *sy
148148
// Add detailed information if requested
149149
if includeDetails {
150150
details := &packageversions.PackageDetails{
151-
Description: packageversions.StringPtr(info.Crate.Description),
152-
Homepage: packageversions.StringPtr(info.Crate.Homepage),
153-
Repository: packageversions.StringPtr(info.Crate.Repository),
154-
Documentation: packageversions.StringPtr(info.Crate.Documentation),
155-
Downloads: packageversions.Int64Ptr(info.Crate.Downloads),
156-
CreatedAt: packageversions.StringPtr(info.Crate.CreatedAt),
157-
UpdatedAt: packageversions.StringPtr(info.Crate.UpdatedAt),
158-
NumVersions: packageversions.IntPtr(info.Crate.NumVersions),
151+
Description: new(info.Crate.Description),
152+
Homepage: new(info.Crate.Homepage),
153+
Repository: new(info.Crate.Repository),
154+
Documentation: new(info.Crate.Documentation),
155+
Downloads: new(info.Crate.Downloads),
156+
CreatedAt: new(info.Crate.CreatedAt),
157+
UpdatedAt: new(info.Crate.UpdatedAt),
158+
NumVersions: new(info.Crate.NumVersions),
159159
Keywords: info.Crate.Keywords,
160160
}
161161

162162
// Add Rust-specific details
163163
rustDetails := &packageversions.RustDetails{
164164
Categories: info.Crate.Categories,
165-
RecentDownloads: packageversions.Int64Ptr(info.Crate.RecentDownloads),
165+
RecentDownloads: new(info.Crate.RecentDownloads),
166166
}
167167

168168
// Add latest version details if available
169169
if len(info.Versions) > 0 {
170170
latestVersion := info.Versions[0]
171-
details.License = packageversions.StringPtr(latestVersion.License)
172-
details.PublishedAt = packageversions.StringPtr(latestVersion.CreatedAt)
173-
rustDetails.RustVersion = packageversions.StringPtr(latestVersion.RustVersion)
174-
rustDetails.Edition = packageversions.StringPtr(latestVersion.Edition)
175-
rustDetails.CrateSize = packageversions.Int64Ptr(latestVersion.CrateSize)
171+
details.License = new(latestVersion.License)
172+
details.PublishedAt = new(latestVersion.CreatedAt)
173+
rustDetails.RustVersion = new(latestVersion.RustVersion)
174+
rustDetails.Edition = new(latestVersion.Edition)
175+
rustDetails.CrateSize = new(latestVersion.CrateSize)
176176
if latestVersion.PublishedBy.Login != "" {
177-
details.Publisher = packageversions.StringPtr(fmt.Sprintf("%s (%s)", latestVersion.PublishedBy.Name, latestVersion.PublishedBy.Login))
177+
details.Publisher = new(fmt.Sprintf("%s (%s)", latestVersion.PublishedBy.Name, latestVersion.PublishedBy.Login))
178178
}
179179
}
180180

0 commit comments

Comments
 (0)