Skip to content

Commit

Permalink
Merge pull request #278 from 88labs/enhancement/replace-faker-v3-v4
Browse files Browse the repository at this point in the history
enhancement: replace go-faker/faker/v4
  • Loading branch information
tomtwinkle authored Sep 26, 2023
2 parents 59493c7 + 3fd1a2b commit b7c8884
Show file tree
Hide file tree
Showing 24 changed files with 98 additions and 57 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@
task -p test
```

## Import format
- required [Task](https://github.com/go-task/task)
- install go-oif
```shell
curl -sSfL https://raw.githubusercontent.com/heyvito/go-oif/main/install.sh | sh -s -- -b $(go env GOPATH)/bin
```
- run
```shell
task -p go-oif
```

## Go modules
- required [Task](https://github.com/go-task/task)
- go mod tidy all packages
```shell
task go-mod-tidy
```
task -p go-mod-tidy
```
44 changes: 43 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,48 @@ tasks:
cmds:
- go mod tidy

go-oif:
deps: [
go-oif-aws,go-oif-cerrors,go-oif-envlookup,go-oif-errgroup,go-oif-osext,
go-oif-sql-escape,go-oif-tspb_cast,go-oif-ulid,go-oif-utf8bom,
]
go-oif-aws:
dir: aws
cmds:
- go-oif ./...
go-oif-cerrors:
dir: cerrors
cmds:
- go-oif ./...
go-oif-envlookup:
dir: envlookup
cmds:
- go-oif ./...
go-oif-errgroup:
dir: errgroup
cmds:
- go-oif ./...
go-oif-osext:
dir: osext
cmds:
- go-oif ./...
go-oif-sql-escape:
dir: sql-escape
cmds:
- go-oif ./...
go-oif-tspb_cast:
dir: tspb_cast
cmds:
- go-oif ./...
go-oif-ulid:
dir: ulid
cmds:
- go-oif ./...
go-oif-utf8bom:
dir: utf8bom
cmds:
- go-oif ./...

go-mod-updates:
deps: [
go-mod-update-aws,go-mod-update-cerrors,go-mod-update-envlookup,go-mod-update-errgroup,go-mod-update-osext,
Expand Down Expand Up @@ -129,4 +171,4 @@ tasks:
go-mod-update-utf8bom:
dir: utf8bom
cmds:
- go get -u ./...
- go get -u ./...
3 changes: 1 addition & 2 deletions aws/awscognito/awscognito.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import (
"context"
"fmt"

"github.com/88labs/go-utils/aws/ctxawslocal"

"github.com/aws/aws-sdk-go-v2/aws"
awsConfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/cognitoidentity"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/ctxawslocal"
)

// GetCredentialsForIdentity
Expand Down
4 changes: 2 additions & 2 deletions aws/awsdynamo/awsdynamo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"testing"
"time"

"github.com/88labs/go-utils/ulid"
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue"
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression"
"github.com/bxcodec/faker/v3"
"github.com/go-faker/faker/v4"
"github.com/stretchr/testify/assert"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awsdynamo"
"github.com/88labs/go-utils/aws/ctxawslocal"
"github.com/88labs/go-utils/ulid"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions aws/awsdynamo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"sync"
"time"

"github.com/88labs/go-utils/aws/ctxawslocal"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
awsConfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/ctxawslocal"
)

var dynamoDBClient *dynamodb.Client
Expand Down
9 changes: 3 additions & 6 deletions aws/awss3/awss3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,21 @@ import (
"strings"
"time"

"github.com/cenkalti/backoff/v4"

"github.com/88labs/go-utils/aws/awss3/options/s3list"

"github.com/88labs/go-utils/aws/awss3/options/s3head"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go"
awshttp "github.com/aws/smithy-go/transport/http"
"github.com/cenkalti/backoff/v4"
"github.com/tomtwinkle/utfbomremover"
"golang.org/x/sync/errgroup"
"golang.org/x/text/transform"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awss3/options/s3download"
"github.com/88labs/go-utils/aws/awss3/options/s3head"
"github.com/88labs/go-utils/aws/awss3/options/s3list"
"github.com/88labs/go-utils/aws/awss3/options/s3presigned"
"github.com/88labs/go-utils/aws/awss3/options/s3selectcsv"
"github.com/88labs/go-utils/aws/awss3/options/s3upload"
Expand Down
6 changes: 3 additions & 3 deletions aws/awss3/awss3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import (
"testing"
"time"

"github.com/88labs/go-utils/ulid"
"github.com/88labs/go-utils/utf8bom"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/bxcodec/faker/v3"
"github.com/go-faker/faker/v4"
"github.com/stretchr/testify/assert"

"github.com/88labs/go-utils/aws/awsconfig"
Expand All @@ -27,8 +29,6 @@ import (
"github.com/88labs/go-utils/aws/awss3/options/s3presigned"
"github.com/88labs/go-utils/aws/awss3/options/s3selectcsv"
"github.com/88labs/go-utils/aws/ctxawslocal"
"github.com/88labs/go-utils/ulid"
"github.com/88labs/go-utils/utf8bom"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions aws/awss3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import (
"fmt"
"net"

"github.com/88labs/go-utils/aws/awss3/options/global/s3dialer"

"github.com/aws/aws-sdk-go-v2/aws"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
awsConfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awss3/options/global/s3dialer"
"github.com/88labs/go-utils/aws/ctxawslocal"
)

Expand Down
9 changes: 5 additions & 4 deletions aws/awss3/options/global/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (
"testing"
"time"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awss3"
"github.com/88labs/go-utils/aws/awss3/options/global/s3dialer"
"github.com/88labs/go-utils/aws/ctxawslocal"
"github.com/88labs/go-utils/ulid"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/stretchr/testify/assert"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awss3"
"github.com/88labs/go-utils/aws/awss3/options/global/s3dialer"
"github.com/88labs/go-utils/aws/ctxawslocal"
)

const (
Expand Down
4 changes: 1 addition & 3 deletions aws/awss3/options/global/s3dialer/s3dialer.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package s3dialer

import (
"time"
)
import "time"

type ConfGlobalDialer struct {
// Timeout is the maximum amount of time a dial will wait for
Expand Down
4 changes: 1 addition & 3 deletions aws/awss3/options/s3head/s3_head.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package s3head

import (
"time"
)
import "time"

type OptionS3Head interface {
Apply(*confS3Head)
Expand Down
4 changes: 1 addition & 3 deletions aws/awss3/options/s3presigned/s3_presigned.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package s3presigned

import (
"time"
)
import "time"

type OptionS3Presigned interface {
Apply(*confS3Presigned)
Expand Down
4 changes: 1 addition & 3 deletions aws/awss3/options/s3upload/s3_upload.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package s3upload

import (
"time"
)
import "time"

type OptionS3Upload interface {
Apply(*confS3Upload)
Expand Down
3 changes: 1 addition & 2 deletions aws/awssqs/awssqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"encoding/gob"
"encoding/json"

"github.com/88labs/go-utils/aws/awsconfig"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/sqs"
"github.com/aws/aws-sdk-go-v2/service/sqs/types"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awssqs/options/sqsreceive"
"github.com/88labs/go-utils/aws/awssqs/options/sqssend"
)
Expand Down
5 changes: 2 additions & 3 deletions aws/awssqs/awssqs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"testing"
"time"

"github.com/88labs/go-utils/aws/awsconfig"

"github.com/bxcodec/faker/v3"
"github.com/go-faker/faker/v4"
"github.com/stretchr/testify/assert"
"golang.org/x/sync/errgroup"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/awssqs"
"github.com/88labs/go-utils/aws/awssqs/options/sqsreceive"
"github.com/88labs/go-utils/aws/ctxawslocal"
Expand Down
3 changes: 1 addition & 2 deletions aws/awssqs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import (
"context"
"fmt"

"github.com/88labs/go-utils/aws/ctxawslocal"

"github.com/aws/aws-sdk-go-v2/aws"
awsConfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/sqs"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/aws/ctxawslocal"
)

// GetClient
Expand Down
4 changes: 1 addition & 3 deletions aws/awssqs/options/sqssend/send_message_options.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package sqssend

import (
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
)
import "github.com/aws/aws-sdk-go-v2/service/sqs/types"

type SendMessageOption interface {
Apply(*confSendMessage)
Expand Down
4 changes: 1 addition & 3 deletions aws/ctxawslocal/ctxawslocal.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ctxawslocal

import (
"context"
)
import "context"

type ctxKeyLocal struct{}

Expand Down
2 changes: 1 addition & 1 deletion aws/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
github.com/aws/aws-sdk-go-v2/service/s3 v1.38.5
github.com/aws/aws-sdk-go-v2/service/sqs v1.24.5
github.com/aws/smithy-go v1.14.2
github.com/bxcodec/faker/v3 v3.8.1
github.com/cenkalti/backoff/v4 v4.2.1
github.com/go-faker/faker/v4 v4.2.0
github.com/stretchr/testify v1.8.4
github.com/tomtwinkle/utfbomremover v0.1.1
golang.org/x/sync v0.3.0
Expand Down
3 changes: 2 additions & 1 deletion aws/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.22.0/go.mod h1:VC7JDqsqiwXukYEDjoHh9
github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ=
github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/bxcodec/faker/v3 v3.8.1 h1:qO/Xq19V6uHt2xujwpaetgKhraGCapqY2CRWGD/SqcM=
github.com/bxcodec/faker/v3 v3.8.1/go.mod h1:DdSDccxF5msjFo5aO4vrobRQ8nIApg8kq3QWPEQD6+o=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-faker/faker/v4 v4.2.0 h1:dGebOupKwssrODV51E0zbMrv5e2gO9VWSLNC1WDCpWg=
github.com/go-faker/faker/v4 v4.2.0/go.mod h1:F/bBy8GH9NxOxMInug5Gx4WYeG6fHJZ8Ol/dhcpRub4=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
Expand Down
5 changes: 3 additions & 2 deletions envlookup/envlookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"time"

"github.com/88labs/go-utils/aws/awsconfig"
"github.com/88labs/go-utils/envlookup"
"github.com/bxcodec/faker/v3"
"github.com/go-faker/faker/v4"
"github.com/stretchr/testify/assert"

"github.com/88labs/go-utils/envlookup"
)

func TestLookUpString(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion envlookup/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ go 1.20

require (
github.com/88labs/go-utils/aws v0.43.0
github.com/bxcodec/faker/v3 v3.8.1
github.com/go-faker/faker/v4 v4.2.0
github.com/stretchr/testify v1.8.4
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/text v0.12.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit b7c8884

Please sign in to comment.