Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/phonedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/xluohome/phonedata"
"github.com/hetao29/phonedata"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/xluohome/phonedata
module github.com/hetao29/phonedata

go 1.16
go 1.21
7 changes: 4 additions & 3 deletions phonedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"runtime"
)

const (
Expand Down Expand Up @@ -53,8 +53,9 @@ var (
func init() {
dir := os.Getenv("PHONE_DATA_DIR")
if dir == "" {
_, fulleFilename, _, _ := runtime.Caller(0)
dir = path.Dir(fulleFilename)
_file, _ := exec.LookPath(os.Args[0])
dir, _ = path.Split(_file)
os.Chdir(dir)
}
var err error
content, err = ioutil.ReadFile(path.Join(dir, PHONE_DAT))
Expand Down