Skip to content

Commit

Permalink
use Dir instead of Root
Browse files Browse the repository at this point in the history
  • Loading branch information
xhd2015 committed Apr 21, 2024
1 parent ee13987 commit 71d181d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cmd/xgo/runtime_gen/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const VERSION = "1.0.25"
const REVISION = "6a13d77b507fde52f56e8fa8db12e89b2a325a5e+1"
const NUMBER = 197
const REVISION = "4e6a5615d778b8909e3315a2ead323822581dd0e+1"
const NUMBER = 198

// these fields will be filled by compiler
const XGO_VERSION = ""
Expand Down
6 changes: 3 additions & 3 deletions cmd/xgo/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ func addBlankImports(goroot string, goBinary string, projectDir string, pkgArgs
// no files
continue
}
srcFile := filepath.Join(pkg.Root, file)
srcFile := filepath.Join(pkg.Dir, file)
dstFile := filepath.Join(tmpProjectDir, srcFile)
err := filecopy.CopyFileAll(srcFile, dstFile)
if err != nil {
Expand Down Expand Up @@ -445,9 +445,9 @@ func isDir(path string) bool {
}

type GoListPkg struct {
Dir string
Dir string // real dir
ImportPath string
Root string
Root string // project root
Standard bool
GoFiles []string
TestGoFiles []string
Expand Down
4 changes: 2 additions & 2 deletions cmd/xgo/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import "fmt"

const VERSION = "1.0.25"
const REVISION = "6a13d77b507fde52f56e8fa8db12e89b2a325a5e+1"
const NUMBER = 197
const REVISION = "4e6a5615d778b8909e3315a2ead323822581dd0e+1"
const NUMBER = 198

func getRevision() string {
revSuffix := ""
Expand Down
4 changes: 2 additions & 2 deletions runtime/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const VERSION = "1.0.25"
const REVISION = "6a13d77b507fde52f56e8fa8db12e89b2a325a5e+1"
const NUMBER = 197
const REVISION = "4e6a5615d778b8909e3315a2ead323822581dd0e+1"
const NUMBER = 198

// these fields will be filled by compiler
const XGO_VERSION = ""
Expand Down
2 changes: 1 addition & 1 deletion support/fileutil/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func CleanSpecial(path string) string {
j++
continue
}
if ch < 128 && !(ch == '_' || ch == '-' || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
if ch < 128 && !(ch == '.' || ch == '_' || ch == '-' || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
continue
}
chars[j] = chars[i]
Expand Down
3 changes: 2 additions & 1 deletion support/fileutil/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ func TestCleanSpecial(t *testing.T) {
Res string
}{
{"", ""},
{" ", "_"}, // space to _
{" ", "_"}, // space to _
{"._-", "._-"}, // ._- reserved
{"/", ""},
{"/a", "a"},
{"C:/a", "Ca"}, // Windows
Expand Down

0 comments on commit 71d181d

Please sign in to comment.