Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

path.go 461B

1234567891011121314151617
  1. // Copyright 2017 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. package util
  5. import "path/filepath"
  6. // EnsureAbsolutePath ensure that a path is absolute, making it
  7. // relative to absoluteBase if necessary
  8. func EnsureAbsolutePath(path string, absoluteBase string) string {
  9. if filepath.IsAbs(path) {
  10. return path
  11. }
  12. return filepath.Join(absoluteBase, path)
  13. }