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 522B

1234567891011121314151617181920212223242526
  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. package main
  6. import (
  7. "log"
  8. "os"
  9. "code.gitea.io/gitea/build/codeformat"
  10. )
  11. func main() {
  12. if len(os.Args) <= 1 {
  13. log.Fatalf("Usage: gitea-format-imports [files...]")
  14. }
  15. for _, file := range os.Args[1:] {
  16. if err := codeformat.FormatGoImports(file); err != nil {
  17. log.Fatalf("can not format file %s, err=%v", file, err)
  18. }
  19. }
  20. }