chore(ci): add govulncheck, staticcheck, go vet, gofumpt gates
* Add lint/format checks to the Gitea release workflow and Makefile (targets: vet, fmt, fmt-check, staticcheck, govulncheck, check) * Switch .golangci.json formatter from gofmt to gofumpt (extra.group-params) * Bump golang.org/x/text 0.37.0 -> 0.39.0 for GO-2026-5970; re-vendor * Fix staticcheck S1011 in pkg/diff; drop unused pgsql writer helpers * Fix gocritic unnamedResult (pkg/diff) and rangeValCopy (pkg/pgsql) * Apply gofumpt + goimports formatting across the tree
This commit is contained in:
@@ -285,7 +285,7 @@ func (w *Writer) generateFilename(data *TemplateData) (string, error) {
|
||||
}
|
||||
|
||||
// writeOutput writes the output to a file or stdout
|
||||
func (w *Writer) writeOutput(content string, outputPath string) error {
|
||||
func (w *Writer) writeOutput(content, outputPath string) error {
|
||||
// If output path is empty, write to stdout
|
||||
if outputPath == "" {
|
||||
fmt.Print(content)
|
||||
@@ -295,13 +295,13 @@ func (w *Writer) writeOutput(content string, outputPath string) error {
|
||||
// Ensure directory exists
|
||||
dir := filepath.Dir(outputPath)
|
||||
if dir != "." && dir != "" {
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
if err := os.MkdirAll(dir, 0o755); err != nil {
|
||||
return fmt.Errorf("failed to create directory %s: %w", dir, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Write to file
|
||||
if err := os.WriteFile(outputPath, []byte(content), 0644); err != nil {
|
||||
if err := os.WriteFile(outputPath, []byte(content), 0o644); err != nil {
|
||||
return fmt.Errorf("failed to write file %s: %w", outputPath, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user