mirror of
https://gitee.com/johng/gf
synced 2026-07-04 13:02:36 +08:00
27 lines
510 B
Go
27 lines
510 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/g/os/glog"
|
|
|
|
"github.com/gogf/gf/g/errors/gerror"
|
|
)
|
|
|
|
func OpenFile() error {
|
|
return gerror.New("permission denied")
|
|
}
|
|
|
|
func OpenConfig() error {
|
|
return gerror.Wrap(OpenFile(), "configuration file opening failed")
|
|
}
|
|
|
|
func ReadConfig() error {
|
|
return gerror.Wrap(OpenConfig(), "reading configuration failed")
|
|
}
|
|
|
|
func main() {
|
|
//glog.Println(OpenConfig())
|
|
glog.Printf("unexpected error: %+s", ReadConfig())
|
|
//glog.Errorf("unexpected error: %+s", OpenConfig())
|
|
|
|
}
|