From f6f9ca6387fea3a984f23a83c22a0d60c95264b2 Mon Sep 17 00:00:00 2001 From: Tronje Krop Date: Tue, 14 Nov 2023 12:59:39 +0100 Subject: [PATCH] feat: small updates and extensions (#57) * feat: small updates and extensions (#57) Signed-off-by: tkrop --- README.md | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- internal/mock/common_test.go | 5 +++++ revive.toml | 4 ++-- test/caller_test.go | 2 +- test/testing.go | 1 + 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a9a41c3..1b84036 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ [report-badge]: https://goreportcard.com/badge/github.com/tkrop/go-testing [report-link]: https://goreportcard.com/report/github.com/tkrop/go-testing -[fossa-badge]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftkrop%2Ftesting.svg?type=shield -[fossa-link]: https://app.fossa.com/projects/git%2Bgithub.com%2Ftkrop%2Ftesting?ref=badge_shield +[fossa-badge]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftkrop%2Ftesting.svg?type=shield&issueType=license +[fossa-link]: https://app.fossa.com/projects/git%2Bgithub.com%2Ftkrop%2Ftesting?ref=badge_shield&issueType=license [license-badge]: https://img.shields.io/badge/License-MIT-yellow.svg [license-link]: https://opensource.org/licenses/MIT diff --git a/go.mod b/go.mod index ecabccd..96aa88a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/h2non/gock v1.2.0 github.com/huandu/go-clone v1.6.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa golang.org/x/text v0.13.0 golang.org/x/tools v0.15.0 ) diff --git a/go.sum b/go.sum index 207ec5c..5101e97 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 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/exp v0.0.0-20231108232855-2478ac86f678 h1:mchzmB1XO2pMaKFRqk/+MV3mgGG96aqaPXaMifQU47w= -golang.org/x/exp v0.0.0-20231108232855-2478ac86f678/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= diff --git a/internal/mock/common_test.go b/internal/mock/common_test.go index 9740d68..46c48c7 100644 --- a/internal/mock/common_test.go +++ b/internal/mock/common_test.go @@ -200,6 +200,11 @@ var ( Params: []*Param{}, Results: []*Param{{Type: "string"}}, Variadic: false, + }, { + Name: "TempDir", + Params: []*Param{}, + Results: []*Param{{Type: "string"}}, + Variadic: false, }} methodsTestReporter = []*Method{{ diff --git a/revive.toml b/revive.toml index e47f887..808d0b0 100644 --- a/revive.toml +++ b/revive.toml @@ -1,4 +1,4 @@ -# Translates the 'golangci-lint' settings into an codacy understandable format. +# Translates the 'golangci-lint' settings into an Codacy understandable format. # When set to false, ignores files with "GENERATED" header. ignoreGeneratedHeader = true @@ -83,7 +83,7 @@ enableAllRules = true [rule.line-length-limit] arguments = [100] -# We are a bit more relexed with function length consistent with funlen. +# We are a bit more relaxed with function length consistent with funlen. [rule.function-length] arguments = [40,60] diff --git a/test/caller_test.go b/test/caller_test.go index 982b783..3113256 100644 --- a/test/caller_test.go +++ b/test/caller_test.go @@ -94,7 +94,7 @@ var ( }() // CallerTestErrorf provides the file with the line number of the `Errorf` // call in testing. - CallerTestErrorf = path.Join(SourceDir, "testing.go:175") + CallerTestErrorf = path.Join(SourceDir, "testing.go:176") // CallerGomockErrorf provides the file with the line number of the // `Errorf` call in gomock. CallerGomockErrorf = path.Join(SourceDir, "gomock.go:61") diff --git a/test/testing.go b/test/testing.go index f4e8a53..13fca0b 100644 --- a/test/testing.go +++ b/test/testing.go @@ -89,6 +89,7 @@ type Reporter interface { type Test interface { Helper() Name() string + TempDir() string Errorf(format string, args ...any) Fatalf(format string, args ...any) FailNow()