未验证 提交 6a3b78ed 编写于 作者: P Phodal Huang

refactor: remove duplidate java path function

上级 5b0757e9
......@@ -139,12 +139,7 @@ func updateFile(path string, lineNum int, newImp string) {
func copyClass(originFile string, newFile string) {
originFile = buildJavaPath(originFile)
// TODO: 适配 Windows
if runtime.GOOS == "windows" {
newFile = strings.ReplaceAll(newFile, ".", "\\") + ".java"
} else {
newFile = strings.ReplaceAll(newFile, ".", "/") + ".java"
}
newFile = buildJavaPath(newFile)
_, err := CopyFile(originFile, newFile)
if err != nil {
......@@ -154,7 +149,6 @@ func copyClass(originFile string, newFile string) {
func buildJavaPath(originFile string) string {
// TODO: 适配 Windows
str := ""
if runtime.GOOS == "windows" {
str = strings.ReplaceAll(originFile, ".", "\\") + ".java"
......
......@@ -7,7 +7,7 @@ import (
"testing"
)
func TestNewMoveClassApp(t *testing.T) {
func TestMoveClassApp(t *testing.T) {
g := NewGomegaWithT(t)
config := "../../../../_fixtures/refactor/move.config"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册