lib: Use counterfeiter to mock interfaces in tests (#7375)
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ import (
|
||||
|
||||
// Inception, go generate calls the script itself that then deals with generation.
|
||||
// This is only done because go:generate does not support wildcards in paths.
|
||||
//go:generate go run generate.go lib/protocol lib/config lib/fs lib/db
|
||||
//go:generate go run generate.go lib/protocol lib/config lib/fs lib/db lib/discover
|
||||
|
||||
func main() {
|
||||
for _, path := range os.Args[1:] {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package discover;
|
||||
|
||||
import "repos/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
import "ext.proto";
|
||||
|
||||
message Announce {
|
||||
bytes id = 1 [(ext.goname) = "ID", (ext.device_id) = true, (gogoproto.nullable) = false];
|
||||
repeated string addresses = 2;
|
||||
int64 instance_id = 3 [(ext.goname) = "InstanceID"];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package protocol;
|
||||
|
||||
import "ext.proto";
|
||||
import "repos/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
message TestOldDeviceID {
|
||||
bytes test = 1;
|
||||
}
|
||||
|
||||
message TestNewDeviceID {
|
||||
bytes test = 1 [(ext.device_id) = true, (gogoproto.nullable) = false];
|
||||
}
|
||||
Reference in New Issue
Block a user