mattermost/server/path.go

19 lines
442 B
Go
Raw Permalink Normal View History

2024-05-10 17:13:05 -04:00
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
2024-05-15 11:05:13 -04:00
package server
2024-05-10 17:13:05 -04:00
import (
"path/filepath"
"runtime"
)
// GetPackagePath returns the filepath to this package for use in tests that need to read data here.
func GetPackagePath() string {
// Find the path to this file
_, filename, _, _ := runtime.Caller(0)
// Return the containing directory
return filepath.Dir(filename)
}