plugeth/signer/fourbyte
Eng Zer Jun 8d066f1f42
all: use T.TempDir to create temporary test directories (#24633)
This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-08 15:44:55 +02:00
..
4byte.go signer/fourbyte: update signatures, sort and don't compress (#19957) 2019-08-19 12:46:19 +03:00
4byte.json signer/fourbyte: update signatures, sort and don't compress (#19957) 2019-08-19 12:46:19 +03:00
abi_test.go signer: docs - replace wiki links with new doc pages (#22069) 2020-12-27 22:18:57 +01:00
abi.go signer/fourbyte: add support for nested types in selectors (#24407) 2022-03-04 13:39:09 +01:00
fourbyte_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
fourbyte.go signer/fourbyte: update signatures, sort and don't compress (#19957) 2019-08-19 12:46:19 +03:00
validation_test.go signer/core: move API JSON types to separate package (#23275) 2021-07-29 16:06:44 +02:00
validation.go signer/core: move API JSON types to separate package (#23275) 2021-07-29 16:06:44 +02:00