summaryrefslogtreecommitdiff
path: root/readWorkFile.go
diff options
context:
space:
mode:
Diffstat (limited to 'readWorkFile.go')
-rw-r--r--readWorkFile.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/readWorkFile.go b/readWorkFile.go
new file mode 100644
index 0000000..87e31fe
--- /dev/null
+++ b/readWorkFile.go
@@ -0,0 +1,39 @@
+package main
+
+import (
+ "bufio"
+ "os"
+ "strings"
+
+ "go.wit.com/log"
+)
+
+func readControlFile() error {
+ file, err := os.Open("go.work")
+ if err != nil {
+ return err
+ }
+ defer file.Close()
+
+ // pairs := make(map[string]string)
+ // var key string
+
+ scanner := bufio.NewScanner(file)
+ for scanner.Scan() {
+ line := scanner.Text()
+
+ line = strings.TrimSpace(line)
+
+ partsNew := strings.SplitN(line, ":", 2)
+ if len(partsNew) > 1 {
+ continue
+ }
+ log.Info(line)
+ }
+
+ if err := scanner.Err(); err != nil {
+ return err
+ }
+
+ return nil
+}