From 2f241692bde9725c0f7b209aa978d3cf616547e8 Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Sat, 6 Apr 2024 14:06:31 -0700 Subject: [PATCH] x/model: be more clear slice bound for CompleteNoBuild Also, update TODO. --- x/model/name.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x/model/name.go b/x/model/name.go index 2197d2f9..96a09cc3 100644 --- a/x/model/name.go +++ b/x/model/name.go @@ -252,9 +252,6 @@ var builderPool = sync.Pool{ }, } -// TODO(bmizerany): Add WriteTo and use in String and MarshalText with -// strings.Builder and bytes.Buffer, respectively. - // String returns the fullest possible display string in form: // // //:+ @@ -331,7 +328,7 @@ func (r Name) Complete() bool { // CompleteNoBuild is like [Name.Complete] but it does not require the // build part to be present. func (r Name) CompleteNoBuild() bool { - return !slices.Contains(r.parts[:Tag], "") + return !slices.Contains(r.parts[:Build-1], "") } // EqualFold reports whether r and o are equivalent model names, ignoring