未验证 提交 7c9d6f6c 编写于 作者: P Phodal Huang

refactor: remove unused code

上级 7e0b6d37
......@@ -2,7 +2,6 @@ package unused_classes
import (
"encoding/json"
"fmt"
. "github.com/phodal/coca/core/models"
"github.com/phodal/coca/core/support"
"sort"
......@@ -11,11 +10,11 @@ import (
var parsedDeps []JClassNode
func Refactoring() {
func Refactoring() []string {
var analysisPackage = ""
file := support.ReadFile("deps.json")
file := support.ReadCocaFile("deps.json")
if file == nil {
return
return nil
}
_ = json.Unmarshal(file, &parsedDeps)
......@@ -46,7 +45,8 @@ func Refactoring() {
}
sort.Sort(sort.StringSlice(excludePackage))
for _, res := range excludePackage {
fmt.Println(res)
}
//for _, res := range excludePackage {
// fmt.Println(res)
//}
return excludePackage
}
......@@ -21,13 +21,6 @@ func WriteToCocaFile(fileName string, payload string) {
_ = ioutil.WriteFile(reporterPath+"/"+fileName, []byte(payload), os.ModePerm)
}
func IsExistCocaFile(fileName string) bool {
if _, err := os.Stat(reporterPath + "/" + fileName); os.IsNotExist(err) {
return false
}
return true
}
func ReadCocaFile(fileName string) []byte {
return ReadFile(reporterPath + "/" + fileName)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册