mattermost/server/channels/testlib/testdata/path.go
2024-05-10 18:13:05 -03:00

18 lines
440 B
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package testdata
import (
"path/filepath"
"runtime"
)
// GetPackagePath returns the filepath to this package for 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)
}