From 93a6c730692f792d5cad2567aa49260b9c0e09e3 Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Fri, 1 Sep 2023 22:11:23 +0300 Subject: [PATCH] add .golangci.yml --- .golangci.yml | 37 +++++++++++++++++++ Dockerfile | 12 +++--- LICENSE | 2 +- Readme.md | 6 +-- example/multi-files/client/main.go | 6 +-- example/multi-files/file1.proto | 2 +- example/multi-files/file2.proto | 2 +- example/multi-files/stub/greet1.json | 4 +- example/multi-files/stub/greet2.json | 4 +- example/multi-package/bar/bar.proto | 2 +- example/multi-package/client/main.go | 6 +-- example/multi-package/stub/simple.json | 4 +- example/one-of/client/main.go | 4 +- example/one-of/oneof.proto | 2 +- example/one-of/stub/oneof.json | 2 +- example/simple/client/main.go | 4 +- example/simple/simple.proto | 2 +- example/simple/stub/simple.json | 4 +- example/stream/client/main.go | 2 +- example/stream/stream.proto | 2 +- example/stub-subfolders/client/main.go | 6 +-- example/stub-subfolders/stub/stub.json | 4 +- .../stub/subfolder1/stub-in-subfolder.json | 4 +- example/well_known_types/client/main.go | 2 +- example/well_known_types/wkt.proto | 2 +- fix_gopackage.sh | 2 +- go.mod | 10 ++--- gripmock.go | 4 +- pkg/yaml2json/convertor_test.go | 2 +- protoc-gen-gripmock/go.mod | 2 +- protoc-gen-gripmock/server.tmpl | 2 +- protogen/example/go.mod | 2 +- protogen/example/multi-files/file1.proto | 2 +- protogen/example/multi-files/file2.proto | 2 +- protogen/example/multi-package/bar/bar.proto | 2 +- protogen/example/multi-package/foo.proto | 2 +- protogen/example/multi-package/hello.pb.go | 2 +- protogen/example/multi-package/hello.proto | 2 +- .../example/multi-package/hello_grpc.pb.go | 2 +- protogen/example/one-of/oneof.proto | 2 +- protogen/example/simple/simple.proto | 2 +- protogen/example/stream/stream.proto | 2 +- .../stub-subfolders/stub-subfolders.proto | 2 +- protogen/example/well_known_types/wkt.proto | 2 +- protogen/go.mod | 2 +- stub/actions.go | 4 +- stub/api_test.go | 2 +- stub/storage.go | 2 +- stub/stub.go | 2 +- 49 files changed, 112 insertions(+), 75 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..8d48da74 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,37 @@ +run: + timeout: 1m +linters: + enable-all: true + disable: + # deprecated + - nosnakecase + - structcheck + - interfacer + - deadcode + - exhaustivestruct + - maligned + - ifshort + - varcheck + - golint + - scopelint + # not relevant + - varnamelen +linters-settings: + lll: + line-length: 160 + gci: + sections: + - Standard + - Default + - Prefix(github.com/bavix) + depguard: + rules: + main: + allow: + - $gostd + - github.com +issues: + exclude-rules: + - path: (.+)_test.go + linters: + - dupl \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e28d3343..c8a67f0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,20 +15,20 @@ RUN apk -U --no-cache add bash git protobuf &&\ apk del git &&\ apk -v cache clean -COPY . /go/src/github.com/tokopedia/gripmock +COPY . /go/src/github.com/bavix/gripmock # create necessary dirs and export fix_gopackage.sh RUN mkdir /proto /stubs &&\ - ln -s /go/src/github.com/tokopedia/gripmock/fix_gopackage.sh /bin/ + ln -s /go/src/github.com/bavix/gripmock/fix_gopackage.sh /bin/ -RUN cd /go/src/github.com/tokopedia/gripmock/protoc-gen-gripmock &&\ +RUN cd /go/src/github.com/bavix/gripmock/protoc-gen-gripmock &&\ go install -v &&\ - cd /go/src/github.com/tokopedia/gripmock/example/simple/client &&\ + cd /go/src/github.com/bavix/gripmock/example/simple/client &&\ go get -u all &&\ - cd /go/src/github.com/tokopedia/gripmock &&\ + cd /go/src/github.com/bavix/gripmock &&\ go install -v -WORKDIR /go/src/github.com/tokopedia/gripmock +WORKDIR /go/src/github.com/bavix/gripmock EXPOSE 4770 4771 diff --git a/LICENSE b/LICENSE index 0c85926b..ab0be2c7 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 PT Tokopedia + Copyright 2019 PT bavix Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Readme.md b/Readme.md index 82dc062b..aa89e6b5 100644 --- a/Readme.md +++ b/Readme.md @@ -6,11 +6,11 @@ The server implementation is in GoLang but the client can be any programming lan --- ### Announcement: -The latest [version (v1.10)](https://github.com/tokopedia/gripmock/releases/tag/v1.10) of gripmock is requiring `go_package` declaration in the `.proto` file. This is due to the latest update of `protoc` plugin that being used by gripmock is making the `go_package` declaration mandatory. +The latest [version (v1.10)](https://github.com/bavix/gripmock/releases/tag/v1.10) of gripmock is requiring `go_package` declaration in the `.proto` file. This is due to the latest update of `protoc` plugin that being used by gripmock is making the `go_package` declaration mandatory. **Update Feb 2022:** -[Version 1.11-beta](https://github.com/tokopedia/gripmock/releases/tag/v1.11-beta) release is available. +[Version 1.11-beta](https://github.com/bavix/gripmock/releases/tag/v1.11-beta) release is available. It supports **NO** declaration of `go_package`, please download and test before it can be tagged as stable. you can get the docker image using `docker pull tkpd/gripmock:v1.11-beta`. @@ -28,7 +28,7 @@ basic syntax to run GripMock is - On a separate terminal we are gonna add a stub into the stub service. Run `curl -X POST -d '{"service":"Gripmock","method":"SayHello","input":{"equals":{"name":"gripmock"}},"output":{"data":{"message":"Hello GripMock"}}}' localhost:4771/add ` - Now we are ready to test it with our client. You can find a client example file under `example/simple/client/`. Execute one of your preferred language. Example for go: `go run example/simple/client/*.go` -Check [`example`](https://github.com/tokopedia/gripmock/tree/master/example) folder for various usecase of gripmock. +Check [`example`](https://github.com/bavix/gripmock/tree/master/example) folder for various usecase of gripmock. --- diff --git a/example/multi-files/client/main.go b/example/multi-files/client/main.go index 7eca2024..ba6dfb14 100644 --- a/example/multi-files/client/main.go +++ b/example/multi-files/client/main.go @@ -5,7 +5,7 @@ import ( "log" "time" - pb "github.com/tokopedia/gripmock/protogen/example/multi-files" + pb "github.com/bavix/gripmock/protogen/example/multi-files" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -24,7 +24,7 @@ func main() { c := pb.NewGripmock1Client(conn) // Contact the server and print out its response. - r, err := c.SayHello(context.Background(), &pb.Request1{Name: "tokopedia"}) + r, err := c.SayHello(context.Background(), &pb.Request1{Name: "bavix"}) if err != nil { log.Fatalf("error from grpc: %v", err) } @@ -33,7 +33,7 @@ func main() { c2 := pb.NewGripmock2Client(conn) // Contact the server and print out its response. - r2, err := c2.SayHello(context.Background(), &pb.Request2{Name: "tokopedia"}) + r2, err := c2.SayHello(context.Background(), &pb.Request2{Name: "bavix"}) if err != nil { log.Fatalf("error from grpc: %v", err) } diff --git a/example/multi-files/file1.proto b/example/multi-files/file1.proto index 4b9056a6..097d5147 100644 --- a/example/multi-files/file1.proto +++ b/example/multi-files/file1.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package multifiles; -option go_package = "github.com/tokopedia/gripmock/example/multi-files"; +option go_package = "github.com/bavix/gripmock/example/multi-files"; // The Gripmock service definition. service Gripmock1 { // simple unary method diff --git a/example/multi-files/file2.proto b/example/multi-files/file2.proto index c62380c5..b014ab57 100644 --- a/example/multi-files/file2.proto +++ b/example/multi-files/file2.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package multifiles; -option go_package = "github.com/tokopedia/gripmock/example/multi-files"; +option go_package = "github.com/bavix/gripmock/example/multi-files"; service Gripmock2 { // simple unary method rpc SayHello (Request2) returns (Reply2); diff --git a/example/multi-files/stub/greet1.json b/example/multi-files/stub/greet1.json index 1d220379..9b988d40 100644 --- a/example/multi-files/stub/greet1.json +++ b/example/multi-files/stub/greet1.json @@ -3,12 +3,12 @@ "method": "SayHello", "input": { "equals": { - "name": "tokopedia" + "name": "bavix" } }, "output": { "data": { - "message": "Hello Tokopedia 1", + "message": "Hello bavix 1", "return_code": 1 } } diff --git a/example/multi-files/stub/greet2.json b/example/multi-files/stub/greet2.json index e902237a..b5ed55e3 100644 --- a/example/multi-files/stub/greet2.json +++ b/example/multi-files/stub/greet2.json @@ -3,12 +3,12 @@ "method": "SayHello", "input": { "equals": { - "name": "tokopedia" + "name": "bavix" } }, "output": { "data": { - "message": "Hello Tokopedia 2", + "message": "Hello bavix 2", "return_code": 1 } } diff --git a/example/multi-package/bar/bar.proto b/example/multi-package/bar/bar.proto index 49c22ccf..3d549815 100644 --- a/example/multi-package/bar/bar.proto +++ b/example/multi-package/bar/bar.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package bar; // this go_package is simulating alias collision -option go_package = "github.com/tokopedia/gripmock/example/multi-package/bar;multi_package"; +option go_package = "github.com/bavix/gripmock/example/multi-package/bar;multi_package"; message Bar{ string name = 1; diff --git a/example/multi-package/client/main.go b/example/multi-package/client/main.go index a39fee11..b07135be 100644 --- a/example/multi-package/client/main.go +++ b/example/multi-package/client/main.go @@ -6,8 +6,8 @@ import ( "os" "time" - pb "github.com/tokopedia/gripmock/protogen/example/multi-package" - multi_package "github.com/tokopedia/gripmock/protogen/example/multi-package/bar" + pb "github.com/bavix/gripmock/protogen/example/multi-package" + multi_package "github.com/bavix/gripmock/protogen/example/multi-package/bar" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -26,7 +26,7 @@ func main() { c := pb.NewGripmockClient(conn) // Contact the server and print out its response. - name := "tokopedia" + name := "bavix" if len(os.Args) > 1 { name = os.Args[1] } diff --git a/example/multi-package/stub/simple.json b/example/multi-package/stub/simple.json index 01d3451d..af4d6263 100644 --- a/example/multi-package/stub/simple.json +++ b/example/multi-package/stub/simple.json @@ -3,12 +3,12 @@ "method":"Greet", "input":{ "equals":{ - "name":"tokopedia" + "name":"bavix" } }, "output":{ "data":{ - "response":"Hello Tokopedia" + "response":"Hello bavix" } } } \ No newline at end of file diff --git a/example/one-of/client/main.go b/example/one-of/client/main.go index 7cf46820..1fa93501 100644 --- a/example/one-of/client/main.go +++ b/example/one-of/client/main.go @@ -6,7 +6,7 @@ import ( "os" "time" - oneof "github.com/tokopedia/gripmock/protogen/example/one-of" + oneof "github.com/bavix/gripmock/protogen/example/one-of" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -25,7 +25,7 @@ func main() { c := oneof.NewGripmockClient(conn) // Contact the server and print out its response. - name := "tokopedia" + name := "bavix" if len(os.Args) > 1 { name = os.Args[1] } diff --git a/example/one-of/oneof.proto b/example/one-of/oneof.proto index ca15d967..556652d0 100644 --- a/example/one-of/oneof.proto +++ b/example/one-of/oneof.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package oneof; -option go_package = "github.com/tokopedia/gripmock/example/one-of"; +option go_package = "github.com/bavix/gripmock/example/one-of"; // The Gripmock service definition. service Gripmock { diff --git a/example/one-of/stub/oneof.json b/example/one-of/stub/oneof.json index 82e2f56f..895ce82b 100644 --- a/example/one-of/stub/oneof.json +++ b/example/one-of/stub/oneof.json @@ -3,7 +3,7 @@ "method":"SayHello", "input":{ "equals":{ - "name":"tokopedia" + "name":"bavix" } }, "output":{ diff --git a/example/simple/client/main.go b/example/simple/client/main.go index 776fa3af..7e4bce94 100644 --- a/example/simple/client/main.go +++ b/example/simple/client/main.go @@ -6,7 +6,7 @@ import ( "os" "time" - pb "github.com/tokopedia/gripmock/protogen/example/simple" + pb "github.com/bavix/gripmock/protogen/example/simple" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -25,7 +25,7 @@ func main() { c := pb.NewGripmockClient(conn) // Contact the server and print out its response. - name := "tokopedia" + name := "bavix" if len(os.Args) > 1 { name = os.Args[1] } diff --git a/example/simple/simple.proto b/example/simple/simple.proto index f1cc994c..5e6adb54 100644 --- a/example/simple/simple.proto +++ b/example/simple/simple.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package simple; -option go_package = "github.com/tokopedia/gripmock/example/simple"; +option go_package = "github.com/bavix/gripmock/example/simple"; // The Gripmock service definition. service Gripmock { diff --git a/example/simple/stub/simple.json b/example/simple/stub/simple.json index 2438a3c9..11af8a8a 100644 --- a/example/simple/stub/simple.json +++ b/example/simple/stub/simple.json @@ -4,12 +4,12 @@ "method": "SayHello", "input": { "equals": { - "name": "tokopedia" + "name": "bavix" } }, "output": { "data": { - "message": "Hello Tokopedia", + "message": "Hello bavix", "return_code": 1 } } diff --git a/example/stream/client/main.go b/example/stream/client/main.go index ed04e29f..908e89bb 100644 --- a/example/stream/client/main.go +++ b/example/stream/client/main.go @@ -7,7 +7,7 @@ import ( "sync" "time" - pb "github.com/tokopedia/gripmock/protogen/example/stream" + pb "github.com/bavix/gripmock/protogen/example/stream" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) diff --git a/example/stream/stream.proto b/example/stream/stream.proto index a1c10f13..833bc9ae 100644 --- a/example/stream/stream.proto +++ b/example/stream/stream.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package stream; -option go_package = "github.com/tokopedia/gripmock/example/stream"; +option go_package = "github.com/bavix/gripmock/example/stream"; // The Gripmock service definition. service Gripmock { // server to client sreaming diff --git a/example/stub-subfolders/client/main.go b/example/stub-subfolders/client/main.go index d861bc36..9ae8029a 100644 --- a/example/stub-subfolders/client/main.go +++ b/example/stub-subfolders/client/main.go @@ -5,7 +5,7 @@ import ( "log" "time" - pb "github.com/tokopedia/gripmock/protogen/example/stub-subfolders" + pb "github.com/bavix/gripmock/protogen/example/stub-subfolders" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -24,13 +24,13 @@ func main() { c := pb.NewGripmockClient(conn) // Contact the server and print out its response. - r, err := c.SayHello(context.Background(), &pb.Request{Name: "tokopedia"}) + r, err := c.SayHello(context.Background(), &pb.Request{Name: "bavix"}) if err != nil { log.Fatalf("error from grpc: %v", err) } log.Printf("Greeting: %s (return code %d)", r.Message, r.ReturnCode) - r, err = c.SayHello(context.Background(), &pb.Request{Name: "subtokopedia"}) + r, err = c.SayHello(context.Background(), &pb.Request{Name: "subbavix"}) if err != nil { log.Fatalf("error from grpc: %v", err) } diff --git a/example/stub-subfolders/stub/stub.json b/example/stub-subfolders/stub/stub.json index 6bbf0913..2702b5c1 100644 --- a/example/stub-subfolders/stub/stub.json +++ b/example/stub-subfolders/stub/stub.json @@ -3,12 +3,12 @@ "method": "SayHello", "input": { "equals": { - "name": "tokopedia" + "name": "bavix" } }, "output": { "data": { - "message": "Hello Tokopedia", + "message": "Hello bavix", "return_code": 1 } } diff --git a/example/stub-subfolders/stub/subfolder1/stub-in-subfolder.json b/example/stub-subfolders/stub/subfolder1/stub-in-subfolder.json index c4a1e92b..ad696214 100644 --- a/example/stub-subfolders/stub/subfolder1/stub-in-subfolder.json +++ b/example/stub-subfolders/stub/subfolder1/stub-in-subfolder.json @@ -3,12 +3,12 @@ "method": "SayHello", "input": { "equals": { - "name": "subtokopedia" + "name": "subbavix" } }, "output": { "data": { - "message": "Hello Sub Tokopedia", + "message": "Hello Sub bavix", "return_code": 1 } } diff --git a/example/well_known_types/client/main.go b/example/well_known_types/client/main.go index 4b21eb0f..7e8b35a2 100644 --- a/example/well_known_types/client/main.go +++ b/example/well_known_types/client/main.go @@ -5,7 +5,7 @@ import ( "log" "time" - pb "github.com/tokopedia/gripmock/protogen/example/well_known_types" + pb "github.com/bavix/gripmock/protogen/example/well_known_types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" empty "google.golang.org/protobuf/types/known/emptypb" diff --git a/example/well_known_types/wkt.proto b/example/well_known_types/wkt.proto index 9884d959..dfeb3f86 100644 --- a/example/well_known_types/wkt.proto +++ b/example/well_known_types/wkt.proto @@ -5,7 +5,7 @@ package well_known_types; import "google/protobuf/empty.proto"; import "google/protobuf/api.proto"; -option go_package = "github.com/tokopedia/gripmock/example/well_known_types;wkt"; +option go_package = "github.com/bavix/gripmock/example/well_known_types;wkt"; service Gripmock { // this shows us example on using WKT as dependency // api.proto in particular has go_package alias with semicolon diff --git a/fix_gopackage.sh b/fix_gopackage.sh index 026f9ceb..79bef9c9 100755 --- a/fix_gopackage.sh +++ b/fix_gopackage.sh @@ -37,7 +37,7 @@ do # get the line number of "syntax" declaration syntaxLineNum="$(grep -n "syntax" "$newfile" | head -n 1 | cut -d: -f1)" - goPackageString="option go_package = \"github.com/tokopedia/gripmock/protogen/$dir\";" + goPackageString="option go_package = \"github.com/bavix/gripmock/protogen/$dir\";" # append our own go_package delcaration just below "syntax" declaration sed -i "${syntaxLineNum}s~$~\n$goPackageString~" $newfile diff --git a/go.mod b/go.mod index 4503a23f..d62426a8 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ -module github.com/tokopedia/gripmock +module github.com/bavix/gripmock go 1.21 require ( + github.com/bavix/gripmock/protogen v0.0.0 + github.com/bavix/gripmock/protogen/example v0.0.0 github.com/goccy/go-yaml v1.11.0 github.com/google/uuid v1.3.0 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/lithammer/fuzzysearch v1.1.8 github.com/stretchr/testify v1.8.4 - github.com/tokopedia/gripmock/protogen v0.0.0 - github.com/tokopedia/gripmock/protogen/example v0.0.0 golang.org/x/text v0.12.0 google.golang.org/grpc v1.57.0 google.golang.org/protobuf v1.31.0 @@ -32,7 +32,7 @@ require ( ) // this is for generated server to be able to run -replace github.com/tokopedia/gripmock/protogen/example v0.0.0 => ./protogen/example +replace github.com/bavix/gripmock/protogen/example v0.0.0 => ./protogen/example // this is for example client to be able to run -replace github.com/tokopedia/gripmock/protogen v0.0.0 => ./protogen +replace github.com/bavix/gripmock/protogen v0.0.0 => ./protogen diff --git a/gripmock.go b/gripmock.go index da8331b2..cc66ad20 100644 --- a/gripmock.go +++ b/gripmock.go @@ -12,8 +12,8 @@ import ( "strings" "syscall" - _ "github.com/tokopedia/gripmock/protogen" - "github.com/tokopedia/gripmock/stub" + _ "github.com/bavix/gripmock/protogen" + "github.com/bavix/gripmock/stub" ) func main() { diff --git a/pkg/yaml2json/convertor_test.go b/pkg/yaml2json/convertor_test.go index de31ab6e..f88d7ee3 100644 --- a/pkg/yaml2json/convertor_test.go +++ b/pkg/yaml2json/convertor_test.go @@ -1,8 +1,8 @@ package yaml2json_test import ( + "github.com/bavix/gripmock/pkg/yaml2json" "github.com/stretchr/testify/require" - "github.com/tokopedia/gripmock/pkg/yaml2json" "testing" ) diff --git a/protoc-gen-gripmock/go.mod b/protoc-gen-gripmock/go.mod index 9a63d14b..c9458eb3 100644 --- a/protoc-gen-gripmock/go.mod +++ b/protoc-gen-gripmock/go.mod @@ -1,4 +1,4 @@ -module github.com/tokopedia/gripmock/protoc-gen-gripmock +module github.com/bavix/gripmock/protoc-gen-gripmock go 1.21 diff --git a/protoc-gen-gripmock/server.tmpl b/protoc-gen-gripmock/server.tmpl index 6267cc77..e1831dcd 100644 --- a/protoc-gen-gripmock/server.tmpl +++ b/protoc-gen-gripmock/server.tmpl @@ -17,7 +17,7 @@ import ( "google.golang.org/grpc/reflection" "google.golang.org/protobuf/reflect/protoreflect" - "github.com/tokopedia/gripmock/pkg/sdk" + "github.com/bavix/gripmock/pkg/sdk" ) {{ range $package, $alias := .Dependencies }} import {{$alias}} "{{$package}}" diff --git a/protogen/example/go.mod b/protogen/example/go.mod index ec4433ce..29e18fba 100644 --- a/protogen/example/go.mod +++ b/protogen/example/go.mod @@ -1,4 +1,4 @@ -module github.com/tokopedia/gripmock/protogen/example +module github.com/bavix/gripmock/protogen/example go 1.21 diff --git a/protogen/example/multi-files/file1.proto b/protogen/example/multi-files/file1.proto index 1951376d..c9d58e2b 100644 --- a/protogen/example/multi-files/file1.proto +++ b/protogen/example/multi-files/file1.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-files"; +option go_package = "github.com/bavix/gripmock/protogen/example/multi-files"; package multifiles; diff --git a/protogen/example/multi-files/file2.proto b/protogen/example/multi-files/file2.proto index 858d34c7..31502f27 100644 --- a/protogen/example/multi-files/file2.proto +++ b/protogen/example/multi-files/file2.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-files"; +option go_package = "github.com/bavix/gripmock/protogen/example/multi-files"; package multifiles; diff --git a/protogen/example/multi-package/bar/bar.proto b/protogen/example/multi-package/bar/bar.proto index b881ca74..29a7710f 100644 --- a/protogen/example/multi-package/bar/bar.proto +++ b/protogen/example/multi-package/bar/bar.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-package/bar"; +option go_package = "github.com/bavix/gripmock/protogen/example/multi-package/bar"; package bar; // this go_package is simulating alias collision diff --git a/protogen/example/multi-package/foo.proto b/protogen/example/multi-package/foo.proto index 81397f55..b8d883d2 100644 --- a/protogen/example/multi-package/foo.proto +++ b/protogen/example/multi-package/foo.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-package"; +option go_package = "github.com/bavix/gripmock/protogen/example/multi-package"; // simulating neighboring .proto file // but different package diff --git a/protogen/example/multi-package/hello.pb.go b/protogen/example/multi-package/hello.pb.go index 8b2e4ada..519bb44a 100644 --- a/protogen/example/multi-package/hello.pb.go +++ b/protogen/example/multi-package/hello.pb.go @@ -7,7 +7,7 @@ package multi_package import ( - bar "github.com/tokopedia/gripmock/protogen/example/multi-package/bar" + bar "github.com/bavix/gripmock/protogen/example/multi-package/bar" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" diff --git a/protogen/example/multi-package/hello.proto b/protogen/example/multi-package/hello.proto index 09dc2cbc..4081c0fe 100644 --- a/protogen/example/multi-package/hello.proto +++ b/protogen/example/multi-package/hello.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-package"; +option go_package = "github.com/bavix/gripmock/protogen/example/multi-package"; package multi_package; diff --git a/protogen/example/multi-package/hello_grpc.pb.go b/protogen/example/multi-package/hello_grpc.pb.go index a9923721..e1de979a 100644 --- a/protogen/example/multi-package/hello_grpc.pb.go +++ b/protogen/example/multi-package/hello_grpc.pb.go @@ -8,7 +8,7 @@ package multi_package import ( context "context" - bar "github.com/tokopedia/gripmock/protogen/example/multi-package/bar" + bar "github.com/bavix/gripmock/protogen/example/multi-package/bar" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/protogen/example/one-of/oneof.proto b/protogen/example/one-of/oneof.proto index fa2f36ac..72ec4bc9 100644 --- a/protogen/example/one-of/oneof.proto +++ b/protogen/example/one-of/oneof.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/one-of"; +option go_package = "github.com/bavix/gripmock/protogen/example/one-of"; package oneof; diff --git a/protogen/example/simple/simple.proto b/protogen/example/simple/simple.proto index e1e588ba..fbed9cca 100644 --- a/protogen/example/simple/simple.proto +++ b/protogen/example/simple/simple.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/simple"; +option go_package = "github.com/bavix/gripmock/protogen/example/simple"; package simple; diff --git a/protogen/example/stream/stream.proto b/protogen/example/stream/stream.proto index 0fa8f0c9..20d10598 100644 --- a/protogen/example/stream/stream.proto +++ b/protogen/example/stream/stream.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/stream"; +option go_package = "github.com/bavix/gripmock/protogen/example/stream"; package stream; diff --git a/protogen/example/stub-subfolders/stub-subfolders.proto b/protogen/example/stub-subfolders/stub-subfolders.proto index e52f7373..50df5acc 100644 --- a/protogen/example/stub-subfolders/stub-subfolders.proto +++ b/protogen/example/stub-subfolders/stub-subfolders.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/stub-subfolders"; +option go_package = "github.com/bavix/gripmock/protogen/example/stub-subfolders"; package stub_subfolders; diff --git a/protogen/example/well_known_types/wkt.proto b/protogen/example/well_known_types/wkt.proto index d0ca9dee..6fb7a77f 100644 --- a/protogen/example/well_known_types/wkt.proto +++ b/protogen/example/well_known_types/wkt.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "github.com/tokopedia/gripmock/protogen/example/well_known_types"; +option go_package = "github.com/bavix/gripmock/protogen/example/well_known_types"; package well_known_types; diff --git a/protogen/go.mod b/protogen/go.mod index 0543c49f..7be0513c 100644 --- a/protogen/go.mod +++ b/protogen/go.mod @@ -1,3 +1,3 @@ -module github.com/tokopedia/gripmock/protogen +module github.com/bavix/gripmock/protogen go 1.21 diff --git a/stub/actions.go b/stub/actions.go index 56691bf7..6f079263 100644 --- a/stub/actions.go +++ b/stub/actions.go @@ -9,8 +9,8 @@ import ( "os" "strings" - "github.com/tokopedia/gripmock/pkg/storage" - "github.com/tokopedia/gripmock/pkg/yaml2json" + "github.com/bavix/gripmock/pkg/storage" + "github.com/bavix/gripmock/pkg/yaml2json" "golang.org/x/text/cases" "golang.org/x/text/language" ) diff --git a/stub/api_test.go b/stub/api_test.go index f781e13d..7a7f5f3a 100644 --- a/stub/api_test.go +++ b/stub/api_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tokopedia/gripmock/stub" + "github.com/bavix/gripmock/stub" ) func TestStub(t *testing.T) { diff --git a/stub/storage.go b/stub/storage.go index 501dea7e..09aa53ab 100644 --- a/stub/storage.go +++ b/stub/storage.go @@ -8,8 +8,8 @@ import ( "reflect" "regexp" + "github.com/bavix/gripmock/pkg/storage" "github.com/lithammer/fuzzysearch/fuzzy" - "github.com/tokopedia/gripmock/pkg/storage" ) type matchFunc func(interface{}, interface{}) bool diff --git a/stub/stub.go b/stub/stub.go index 10b6335e..a023e0e5 100644 --- a/stub/stub.go +++ b/stub/stub.go @@ -2,9 +2,9 @@ package stub import ( "fmt" + "github.com/bavix/gripmock/pkg/storage" "github.com/gorilla/handlers" "github.com/gorilla/mux" - "github.com/tokopedia/gripmock/pkg/storage" "golang.org/x/text/cases" "golang.org/x/text/language" "log"