tinkering with the mutex / Marshal() problem
This commit is contained in:
parent
25ab223c07
commit
0b5caa03e5
|
@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto"; // Import the well-known type for Time
|
||||||
|
|
||||||
// global settings for autogenpb `autogenpb:mutex`
|
// global settings for autogenpb `autogenpb:mutex`
|
||||||
|
|
||||||
message GoDep { // `autogenpb:2nomutex`
|
message GoDep { // `autogenpb:nomutex`
|
||||||
string hash = 1; // `autogenpb:unique` `autogenpb:sort` // md5sum/hash value from the go.sum file
|
string hash = 1; // `autogenpb:unique` `autogenpb:sort` // md5sum/hash value from the go.sum file
|
||||||
google.protobuf.Timestamp ctime = 2; // get the go date from 'go list' ?
|
google.protobuf.Timestamp ctime = 2; // get the go date from 'go list' ?
|
||||||
string version = 3; // v1.2.2
|
string version = 3; // v1.2.2
|
||||||
|
@ -16,7 +16,7 @@ message GoDep { // `autogenpb:2nomutex`
|
||||||
string goVersion = 5; // version of golang the developer used to make this package version
|
string goVersion = 5; // version of golang the developer used to make this package version
|
||||||
}
|
}
|
||||||
|
|
||||||
message GoDeps { // `autogenpb:2nomutex`
|
message GoDeps { // `autogenpb:nomutex`
|
||||||
string uuid = 1; // `autogenpb:uuid:`
|
string uuid = 1; // `autogenpb:uuid:`
|
||||||
string version = 2; // `autogenpb:version`
|
string version = 2; // `autogenpb:version`
|
||||||
repeated GoDep goDeps = 3; // `autogenpb:unique` `autogenpb:sort`
|
repeated GoDep goDeps = 3; // `autogenpb:unique` `autogenpb:sort`
|
||||||
|
|
|
@ -51,14 +51,16 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) {
|
||||||
// enforces GoPath is unique
|
// enforces GoPath is unique
|
||||||
func (all *Repos) AppendByGoPath(newr *Repo) bool {
|
func (all *Repos) AppendByGoPath(newr *Repo) bool {
|
||||||
all.RLock()
|
all.RLock()
|
||||||
defer all.RUnlock()
|
|
||||||
|
|
||||||
for _, r := range all.Repos {
|
for _, r := range all.Repos {
|
||||||
if r.GoInfo.GoPath == newr.GoInfo.GoPath {
|
if r.GoInfo.GoPath == newr.GoInfo.GoPath {
|
||||||
|
all.RUnlock()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
all.RUnlock()
|
||||||
|
|
||||||
all.Repos = append(all.Repos, newr)
|
// all.Repos = append(all.Repos, newr)
|
||||||
|
all.Append(newr)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ message Repo { // `autogenpb:marshal` `autogenpb:2nomutex`
|
||||||
string state = 23; // status or state. useful for building tooling
|
string state = 23; // status or state. useful for building tooling
|
||||||
}
|
}
|
||||||
|
|
||||||
message Repos { // `autogenpb:marshal` `autogenpb:sort`
|
message Repos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:2nomutex`
|
||||||
string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
|
string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
|
||||||
string version = 2; // `autogenpb:version:2`
|
string version = 2; // `autogenpb:version:2`
|
||||||
repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this
|
repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this
|
||||||
|
|
Loading…
Reference in New Issue