// `autogen:go.mod` module go.wit.com/lib/protobuf/gitpb go 1.21 toolchain go1.23.4 require ( github.com/destel/rill v0.6.0 github.com/go-cmd/cmd v1.4.3 go.wit.com/lib/gui/shell v0.22.20 go.wit.com/log v0.22.10 google.golang.org/protobuf v1.36.2 ) // `autogen:go.sum` github.com/destel/rill v0.6.0 h1:8MQRzS6k0akKmwNZFahKIhG1dkBeNxMoWKSfOxkaJNw= github.com/destel/rill v0.6.0/go.mod h1:srKuXzvGqINUEGYR5b/iwvW+L9/S35RxVHWGYbXNoO4= github.com/go-cmd/cmd v1.4.3 h1:6y3G+3UqPerXvPcXvj+5QNPHT02BUw7p6PsqRxLNA7Y= github.com/go-cmd/cmd v1.4.3/go.mod h1:u3hxg/ry+D5kwh8WvUkHLAMe2zQCaXd00t35WfQaOFk= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= go.wit.com/lib/gui/shell v0.22.20 h1:iVPXL1h1Qri1WrymjfgTy0gRGEepj6+w2e6kSVaBtUk= go.wit.com/lib/gui/shell v0.22.20/go.mod h1:zduuMSWq+EE7w0xbXn+vkoGZ4HJhURVJpvXw8oK9WAU= go.wit.com/log v0.22.10 h1:rlSgaYjvxbpcmi9UBQO3ESmbd/jiyFdRQFoGOvpCEUc= go.wit.com/log v0.22.10/go.mod h1:4uNPFBqhsAh8zNF+zxVEmC3c/9AZ8JeTfUUvRpddvLQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= // `autogen:gitTag.find.pb.go` // Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. // This file was autogenerated with autogenpb v0.0.40-20-g95afc5e 2025.01.11_0606 // go install go.wit.com/apps/autogenpb@latest // // define which structs (messages) you want to use in the .proto file // Then sort.pb.go and marshal.pb.go files are autogenerated // // autogenpb uses it and has an example .proto file with instructions // package gitpb import ( "sync" ) // a simple global lock var gitTagMu sync.RWMutex // just a simple Append() shortcut (but still uses the mutex lock) func (x *GitTags) Append(y *GitTag) { gitTagMu.Lock() defer gitTagMu.Unlock() x.GitTags = append(x.GitTags, y) } // lookup a GitTags by the Refname func (x *GitTags) FindByRefname(s string) *GitTag { if x == nil { return nil } gitTagMu.RLock() defer gitTagMu.RUnlock() for i, _ := range x.GitTags { if x.GitTags[i].Refname == s { return x.GitTags[i] } } return nil } // lookup a GitTags by the Hash func (x *GitTags) FindByHash(s string) *GitTag { if x == nil { return nil } gitTagMu.RLock() defer gitTagMu.RUnlock() for i, _ := range x.GitTags { if x.GitTags[i].Hash == s { return x.GitTags[i] } } return nil } // enforces GitTag.Refname is unique in GitTags.GitTags func (x *GitTags) AppendUniqueRefname(newP *GitTag) bool { gitTagMu.Lock() defer gitTagMu.Unlock() for _, p := range x.GitTags { if p.Refname == newP.Refname { return false } } x.GitTags = append(x.GitTags, newP) return true } // enforces GitTag.Hash is unique in GitTags.GitTags func (x *GitTags) AppendUniqueHash(newP *GitTag) bool { gitTagMu.Lock() defer gitTagMu.Unlock() for _, p := range x.GitTags { if p.Hash == newP.Hash { return false } } x.GitTags = append(x.GitTags, newP) return true } // enforces GitTag is unique in GitTags.GitTags func (x *GitTags) AppendUnique(newP *GitTag) bool { gitTagMu.Lock() defer gitTagMu.Unlock() for _, p := range x.GitTags { if p.Refname == newP.Refname { return false } if p.Hash == newP.Hash { return false } } x.GitTags = append(x.GitTags, newP) return true } func (x *GitTags) DeleteByRefname(s string) bool { gitTagMu.Lock() defer gitTagMu.Unlock() for i, _ := range x.GitTags { if x.GitTags[i].Refname == s { x.GitTags[i] = x.GitTags[len(x.GitTags)-1] x.GitTags = x.GitTags[:len(x.GitTags)-1] return true } } return false } func (x *GitTags) DeleteByHash(s string) bool { gitTagMu.Lock() defer gitTagMu.Unlock() for i, _ := range x.GitTags { if x.GitTags[i].Hash == s { x.GitTags[i] = x.GitTags[len(x.GitTags)-1] x.GitTags = x.GitTags[:len(x.GitTags)-1] return true } } return false } // returns an GitTag if Refname matches, otherwise create func (x *GitTags) InsertByRefname(y string) *GitTag { gitTagMu.Lock() defer gitTagMu.Unlock() for _, p := range x.GitTags { if p.Refname == y { return p } } z := new(GitTag) z.Refname = y x.GitTags = append(x.GitTags, z) return z } // returns an GitTag if Hash matches, otherwise create func (x *GitTags) InsertByHash(y string) *GitTag { gitTagMu.Lock() defer gitTagMu.Unlock() for _, p := range x.GitTags { if p.Hash == y { return p } } z := new(GitTag) z.Hash = y x.GitTags = append(x.GitTags, z) return z } // `autogen:gitTag.marshal.pb.go`