Started to implement registryParser
This commit is contained in:
parent
33aebc8ce3
commit
5a48f755a2
1 changed files with 22 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package Tools
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
|
@ -17,8 +19,28 @@ func CheckIfRegistryFileExists() bool{
|
|||
return true
|
||||
}
|
||||
|
||||
func parseRegistryList() []string{
|
||||
file, err := os.Open("data/registry.list")
|
||||
if err != nil {
|
||||
ErrorLogger.Fatal(err)
|
||||
}
|
||||
|
||||
lines := make([]string, 512)
|
||||
scanner := bufio.NewScanner(file)
|
||||
|
||||
i := 0
|
||||
for scanner.Scan() {
|
||||
if scanner.Text()[0] != '#'{
|
||||
lines[i] = scanner.Text()
|
||||
i++
|
||||
}
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
func LoadRegistryList(){
|
||||
if CheckIfRegistryFileExists(){
|
||||
|
||||
registries := parseRegistryList()
|
||||
}
|
||||
}
|
||||
Reference in a new issue