still protobuf memory corruption

This commit is contained in:
Jeff Carr 2024-11-20 13:56:27 -06:00
parent 09f855910c
commit f1c2695662
3 changed files with 19 additions and 4 deletions

View File

@ -16,6 +16,9 @@ add:
update: update:
./forgeConfig --update --name 'foo' --gopath 'go.wit.com/apps/foonew' ./forgeConfig --update --name 'foo' --gopath 'go.wit.com/apps/foonew'
corruptMemory:
./forgeConfig --update --name 'foo' --gopath 'blah'
goimports: goimports:
goimports -w *.go goimports -w *.go

View File

@ -52,13 +52,14 @@ func main() {
os.Exit(0) os.Exit(0)
} }
testAddRepos(repos) testMemoryCorruption(repos)
repos.ConfigSave() repos.ConfigSave()
} }
func testAddRepos(all *forgepb.Repos) *forgepb.Repos { // this fucks shit up
func testMemoryCorruption(all *forgepb.Repos) *forgepb.Repos {
new1 := new(forgepb.Repo) new1 := new(forgepb.Repo)
new1.Name = "bash" new1.Name = "bash1"
new1.Version = "5.2.21" new1.Version = "5.2.21"
if all.Append(new1) { if all.Append(new1) {
log.Info("added", new1.Name, "ok") log.Info("added", new1.Name, "ok")
@ -67,7 +68,7 @@ func testAddRepos(all *forgepb.Repos) *forgepb.Repos {
} }
new1 = new(forgepb.Repo) new1 = new(forgepb.Repo)
new1.Name = "zookeeper" new1.Name = "zookeeper1"
new1.Debname = "zookeeper-go" new1.Debname = "zookeeper-go"
if all.Append(new1) { if all.Append(new1) {
log.Info("added", new1.Name, "ok") log.Info("added", new1.Name, "ok")

11
update.go Normal file
View File

@ -0,0 +1,11 @@
package forgepb
import (
"os"
)
func (repos *Repos) UpdateGoPath(r *Repo, gopath string) {
r.Gopath = gopath
repos.ConfigSave()
os.Exit(0)
}