You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gitea-format-imports.go 539B

123456789101112131415161718192021222324252627
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. //go:build ignore
  5. // +build ignore
  6. package main
  7. import (
  8. "log"
  9. "os"
  10. "code.gitea.io/gitea/build/codeformat"
  11. )
  12. func main() {
  13. if len(os.Args) <= 1 {
  14. log.Fatalf("Usage: gitea-format-imports [files...]")
  15. }
  16. for _, file := range os.Args[1:] {
  17. if err := codeformat.FormatGoImports(file); err != nil {
  18. log.Fatalf("can not format file %s, err=%v", file, err)
  19. }
  20. }
  21. }