本站源代码
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.

17 lines
461B

  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. }
上海开阖软件有限公司 沪ICP备12045867号-1