Skip to content

Commit

Permalink
Merge pull request #8 from bavix/deprecated-fix
Browse files Browse the repository at this point in the history
deprecated fix
  • Loading branch information
rez1dent3 authored Aug 22, 2023
2 parents 71fdfd4 + d0fc7f4 commit e995988
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GOLANGCI_LING_IMAGE="golangci/golangci-lint:v1.54.0-alpine"
version=latest

build:
docker buildx build --load -t "bavix/gripmock:${version}" --platform linux/amd64,linux/arm64 .
docker buildx build --load -t "bavix/gripmock:${version}" --no-cache --platform linux/arm64 .

test:
go test -tags mock -race -cover ./...
Expand Down
3 changes: 2 additions & 1 deletion example/multi-files/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import (

pb "github.com/tokopedia/gripmock/protogen/example/multi-files"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func main() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion example/multi-package/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
pb "github.com/tokopedia/gripmock/protogen/example/multi-package"
multi_package "github.com/tokopedia/gripmock/protogen/example/multi-package/bar"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func main() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions example/one-of/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import (
"time"

oneof "github.com/tokopedia/gripmock/protogen/example/one-of"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func main() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion example/simple/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import (

pb "github.com/tokopedia/gripmock/protogen/example/simple"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func main() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
7 changes: 4 additions & 3 deletions example/stream/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

pb "github.com/tokopedia/gripmock/protogen/example/stream"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func main() {
Expand All @@ -17,7 +18,7 @@ func main() {
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down Expand Up @@ -46,7 +47,7 @@ func serverStream(c pb.GripmockClient, wg *sync.WaitGroup) {
}
stream, err := c.ServerStream(context.Background(), req)
if err != nil {
log.Fatal("server stream error: %v", err)
log.Fatalf("server stream error: %v", err)
}

for {
Expand All @@ -56,7 +57,7 @@ func serverStream(c pb.GripmockClient, wg *sync.WaitGroup) {
}

if err != nil {
log.Fatal("s2c error: %v", err)
log.Fatalf("s2c error: %v", err)
}

log.Printf("s2c message: %s\n", reply.Message)
Expand Down
3 changes: 2 additions & 1 deletion example/stub-subfolders/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import (

pb "github.com/tokopedia/gripmock/protogen/example/stub-subfolders"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func main() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion example/well_known_types/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/golang/protobuf/ptypes/empty"
pb "github.com/tokopedia/gripmock/protogen/example/well_known_types"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

// in order to generate this .pb.go you need to have https://github.com/google/protobuf.git cloned
Expand All @@ -18,7 +19,7 @@ func main() {
defer cancel()

// Set up a connection to the server.
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ require (
github.com/golang/protobuf v1.5.3
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
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tokopedia/gripmock/protogen v0.0.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
google.golang.org/genproto v0.0.0-20230815205213-6bfd019c3878 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230821184602-ccc8af3d0e93 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230815205213-6bfd019c3878 h1:Iveh6tGCJkHAjJgEqUQYGDGgbwmhjoAOz8kO/ajxefY=
google.golang.org/genproto v0.0.0-20230815205213-6bfd019c3878/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93 h1:zv6ieVm8jNcN33At1+APsRISkRgynuWUxUhv6G123jY=
google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230821184602-ccc8af3d0e93 h1:OpqhBqmDJdwQbcZeN2G+wAjNq6xnmZHrmS+//OOUxT8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230821184602-ccc8af3d0e93/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
Expand Down
4 changes: 2 additions & 2 deletions gripmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func main() {
// and run
run, runerr := runGrpcServer(output)

var term = make(chan os.Signal)
signal.Notify(term, syscall.SIGTERM, syscall.SIGKILL, syscall.SIGINT)
term := make(chan os.Signal, 1)
signal.Notify(term, syscall.SIGTERM, syscall.SIGINT)
select {
case err := <-runerr:
log.Fatal(err)
Expand Down
5 changes: 4 additions & 1 deletion protoc-gen-gripmock/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"golang.org/x/tools/imports"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb"
Expand Down Expand Up @@ -239,6 +241,7 @@ func getGoPackage(proto *descriptor.FileDescriptorProto) (alias string, goPackag
// change the structure also translate method type
func extractServices(protos []*descriptor.FileDescriptorProto) []Service {
svcTmp := []Service{}
title := cases.Title(language.English, cases.NoLower)
for _, proto := range protos {
for _, svc := range proto.GetService() {
var s Service
Expand All @@ -259,7 +262,7 @@ func extractServices(protos []*descriptor.FileDescriptorProto) []Service {
}

methods[j] = methodTemplate{
Name: strings.Title(*method.Name),
Name: title.String(*method.Name),
SvcPackage: s.Package,
ServiceName: svc.GetName(),
Input: getMessageType(protos, method.GetInputType()),
Expand Down
13 changes: 7 additions & 6 deletions protoc-gen-gripmock/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ module github.com/tokopedia/gripmock/protoc-gen-gripmock
go 1.21

require (
github.com/golang/protobuf v1.5.2
golang.org/x/tools v0.1.5
google.golang.org/protobuf v1.27.1
github.com/golang/protobuf v1.5.3
golang.org/x/text v0.12.0
golang.org/x/tools v0.12.0
google.golang.org/protobuf v1.31.0
)

require (
golang.org/x/mod v0.4.2 // indirect
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
)
15 changes: 15 additions & 0 deletions protoc-gen-gripmock/go.sum
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
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=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
8 changes: 4 additions & 4 deletions stub/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"reflect"
"regexp"
"sync"
Expand Down Expand Up @@ -200,7 +200,7 @@ func matches(expect, actual map[string]interface{}) bool {
func find(expect, actual interface{}, acc, exactMatch bool, f matchFunc) bool {

// circuit brake
if acc == false {
if !acc {
return false
}

Expand Down Expand Up @@ -277,7 +277,7 @@ func readStubFromFile(path string) {
}

func (sm *stubMapping) readStubFromFile(path string) {
files, err := ioutil.ReadDir(path)
files, err := os.ReadDir(path)
if err != nil {
log.Printf("Can't read stub from %s. %v\n", path, err)
return
Expand All @@ -289,7 +289,7 @@ func (sm *stubMapping) readStubFromFile(path string) {
continue
}

byt, err := ioutil.ReadFile(path + "/" + file.Name())
byt, err := os.ReadFile(path + "/" + file.Name())
if err != nil {
log.Printf("Error when reading file %s. %v. skipping...", file.Name(), err)
continue
Expand Down
14 changes: 7 additions & 7 deletions stub/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package stub

import (
"encoding/json"
"io/ioutil"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -19,9 +19,9 @@ func Test_readStubFromFile(t *testing.T) {
{
name: "single file, single stub",
mock: func(service, method string, data []storage) (path string) {
dir, err := ioutil.TempDir("", "")
dir, err := os.MkdirTemp("", "")
require.NoError(t, err)
tempF, err := ioutil.TempFile(dir, "")
tempF, err := os.CreateTemp(dir, "")
require.NoError(t, err)
defer tempF.Close()

Expand Down Expand Up @@ -53,9 +53,9 @@ func Test_readStubFromFile(t *testing.T) {
{
name: "single file, multiple stub",
mock: func(service, method string, data []storage) (path string) {
dir, err := ioutil.TempDir("", "")
dir, err := os.MkdirTemp("", "")
require.NoError(t, err)
tempF, err := ioutil.TempFile(dir, "")
tempF, err := os.CreateTemp(dir, "")
require.NoError(t, err)
defer tempF.Close()

Expand Down Expand Up @@ -91,11 +91,11 @@ func Test_readStubFromFile(t *testing.T) {
{
name: "multiple file, single stub",
mock: func(service, method string, data []storage) (path string) {
dir, err := ioutil.TempDir("", "")
dir, err := os.MkdirTemp("", "")
require.NoError(t, err)

for _, d := range data {
tempF, err := ioutil.TempFile(dir, "")
tempF, err := os.CreateTemp(dir, "")
require.NoError(t, err)
defer tempF.Close()

Expand Down
Loading

0 comments on commit e995988

Please sign in to comment.