mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-21 05:54:10 +08:00
Centralize the GetPackagePath (#27004)
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package tests
|
||||
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user