-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg.go
More file actions
29 lines (25 loc) · 920 Bytes
/
pkg.go
File metadata and controls
29 lines (25 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package sure
import (
"reflect"
"github.com/yylego/syntaxgo/syntaxgo_reflect"
)
// GetPkgPath returns the package path of the sure package
// Uses reflection to get the path from ErrorHandlingMode type
// Returns the absolute import path as a string
//
// GetPkgPath 返回 sure 包的包路径
// 使用反射从 ErrorHandlingMode 类型获取路径
// 返回绝对导入路径作为字符串
func GetPkgPath() string {
return reflect.TypeOf(syntaxgo_reflect.GetObject[ErrorHandlingMode]()).PkgPath()
}
// GetPkgName returns the package name of the sure package
// Uses reflection to extract the name from ErrorHandlingMode type
// Returns the package name as a string
//
// GetPkgName 返回 sure 包的包名
// 使用反射从 ErrorHandlingMode 类型提取名称
// 返回包名作为字符串
func GetPkgName() string {
return syntaxgo_reflect.GetPkgName(syntaxgo_reflect.GetObject[ErrorHandlingMode]())
}