Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

remove_windows.go 701B

12345678910111213141516
  1. // +build windows,!go1.7
  2. // Copyright 2017 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package util
  6. // RemoveAll files from path on windows
  7. // workaround for Go not being able to remove read-only files/folders: https://github.com/golang/go/issues/9606
  8. // this bug should be fixed on Go 1.7, so the workaround should be removed when Gitea don't support Go 1.6 anymore:
  9. // https://github.com/golang/go/commit/2ffb3e5d905b5622204d199128dec06cefd57790
  10. func RemoveAll(path string) error {
  11. path = strings.Replace(path, "/", "\\", -1)
  12. return exec.Command("cmd", "/C", "rmdir", "/S", "/Q", path).Run()
  13. }