Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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. }