From 22bc4bbce70eef1b4d10c41873aeb125ff0a0c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 8 Dec 2025 16:40:43 +0000 Subject: [PATCH] cue/ast,mod/modfile: add two more `go:fix inline` directives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These two rewrites are fairly simple, so they are good candidates for `go fix -inline` and gopls going forward. Signed-off-by: Daniel Martí Change-Id: I5b8ba37126f087e5a1c49ea3ce1a693db6b6aaa6 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1227719 Reviewed-by: Roger Peppe TryBot-Result: CUEcueckoo Unity-Result: CUE porcuepine --- cue/ast/ast.go | 2 ++ internal/mod/modfiledata/modfile.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cue/ast/ast.go b/cue/ast/ast.go index 6959747a8..1a6841198 100644 --- a/cue/ast/ast.go +++ b/cue/ast/ast.go @@ -1053,6 +1053,8 @@ outer: // VisitImports iterates through the import declarations in the file. // // Deprecated: use [File.ImportDecls]. +// +//go:fix inline func (f *File) VisitImports(fn func(d *ImportDecl)) { for d := range f.ImportDecls() { fn(d) diff --git a/internal/mod/modfiledata/modfile.go b/internal/mod/modfiledata/modfile.go index bf4de1d33..b6cc3e760 100644 --- a/internal/mod/modfiledata/modfile.go +++ b/internal/mod/modfiledata/modfile.go @@ -81,6 +81,8 @@ func (f *File) QualifiedModule() string { // Deprecated: this method is misnamed; use [File.ModuleRootPath] // instead. +// +//go:fix inline func (f *File) ModulePath() string { return f.ModuleRootPath() } -- 2.51.2