diff --git a/.golangci.yml b/.golangci.yml index 0a2c8a2..4a2a15d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,7 +22,7 @@ linters: - govet - ineffassign - misspell - - exportloopref + - copyloopvar - staticcheck - typecheck - unconvert diff --git a/cmdline/gendoc/gendoc.go b/cmdline/gendoc/gendoc.go index 08e7183..a7a38b6 100644 --- a/cmdline/gendoc/gendoc.go +++ b/cmdline/gendoc/gendoc.go @@ -154,7 +154,7 @@ func writeOutput(out string, runGoFmt bool) error { tagsConstraint = fmt.Sprintf("// +build %s\n\n", flagTags) } - copyright := `// Copyright 2022 The Vanadium Authors. All rights reserved. + copyright := `// Copyright 2024 The Vanadium Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/cmdline/help.go b/cmdline/help.go index 83e4b4f..aa10eeb 100644 --- a/cmdline/help.go +++ b/cmdline/help.go @@ -8,7 +8,7 @@ import ( "bytes" "flag" "fmt" - "go/doc" + "go/doc/comment" "io" "path/filepath" "regexp" @@ -165,12 +165,11 @@ func godocHeader(path, short string) string { // We try our best to create a header that includes both the command path and // the short description, but if godoc won't extract a header out of the line, // we fall back to just returning the command path. - // - // For more details see the comments and implementation of doc.ToHTML: - // http://golang.org/pkg/go/doc/#ToHTML header := firstRuneToUpper(path + " - " + short) var buf bytes.Buffer - doc.ToHTML(&buf, "before\n\n"+header+"\n\nafter", nil) + var p comment.Parser + d := p.Parse("before\n\n" + header + "\n\nafter") + buf.Write(new(comment.Printer).HTML(d)) if !bytes.Contains(buf.Bytes(), []byte("