summaryrefslogtreecommitdiff
path: root/scanGoSrc/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-27 21:40:06 -0600
committerJeff Carr <[email protected]>2024-11-27 21:40:06 -0600
commited3eacfe75e479e8c36cf7ba82a431c567f83602 (patch)
tree450d0cc89758efd161c426868d6cbc6e4ef470d0 /scanGoSrc/main.go
parent8b987962ea21a827d50e7f7430ab58b47274ad0e (diff)
first attempt that seems to kinda work on New()
Diffstat (limited to 'scanGoSrc/main.go')
-rw-r--r--scanGoSrc/main.go61
1 files changed, 61 insertions, 0 deletions
diff --git a/scanGoSrc/main.go b/scanGoSrc/main.go
new file mode 100644
index 0000000..ff24c9c
--- /dev/null
+++ b/scanGoSrc/main.go
@@ -0,0 +1,61 @@
+package main
+
+import (
+ "os"
+
+ "go.wit.com/lib/protobuf/forgepb"
+ "go.wit.com/lib/protobuf/gitpb"
+ "go.wit.com/log"
+)
+
+// sent via ldflags
+var VERSION string
+
+func main() {
+ var config forgepb.ForgeConfigs
+ if err := config.ConfigLoad(); err != nil {
+ log.Warn("forgepb.ConfigLoad() failed", err)
+ os.Exit(-1)
+ }
+
+ config.PrintTable()
+
+ var repos *gitpb.Repos
+ repos = new(gitpb.Repos)
+
+ newr, err := repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/wit-package")
+ if err != nil {
+ log.Info("init failed", err)
+ } else {
+ log.Info("init worked for", newr.GoPath)
+ }
+
+ newr, err = repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/notathing")
+ if err != nil {
+ log.Info("init failed correctly:", err)
+ } else {
+ log.Info("init should have failed for", newr.GoPath)
+ }
+
+ /*
+ log.Info(forgepb.RepoHeader())
+ loop := repos.SortByPath() // get the list of repos
+ for loop.Scan() {
+ r := loop.Repo()
+ log.Info("repo:", r.GoPath)
+ }
+ */
+ /*
+ log.Info("going to add a new repo", argv.GoPath)
+ new1 := forgepb.Repo{
+ GoPath: argv.GoPath,
+ Writable: argv.Writable,
+ ReadOnly: argv.ReadOnly,
+ Private: argv.Private,
+ Directory: argv.Directory,
+ Favorite: argv.Favorite,
+ Interesting: argv.Interesting,
+ }
+ */
+ os.Exit(0)
+}