Skip to content

Commit f910bd5

Browse files
author
Dean Karn
authored
Add Nothing (#33)
1 parent 823004f commit f910bd5

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [5.18.0] - 2023-05-21
10+
### Added
11+
- typesext.Nothing & valuesext.Nothing for better clarity in generic params and values that represent struct{}. This will provide better code readability and intent.
12+
913
## [5.17.2] - 2023-05-09
1014
### Fixed
1115
- Prematurely closing http.Response Body before error with it can be intercepted for ErrUnexpectedResponse.
@@ -46,7 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4650
### Added
4751
- Added `timext.NanoTime` for fast low level monotonic time with nanosecond precision.
4852

49-
[Unreleased]: https://github.com/go-playground/pkg/compare/v5.17.2...HEAD
53+
[Unreleased]: https://github.com/go-playground/pkg/compare/v5.18.0...HEAD
54+
[5.18.0]: https://github.com/go-playground/pkg/compare/v5.17.2..v5.18.0
5055
[5.17.2]: https://github.com/go-playground/pkg/compare/v5.17.1..v5.17.2
5156
[5.17.1]: https://github.com/go-playground/pkg/compare/v5.17.0...v5.17.1
5257
[5.17.0]: https://github.com/go-playground/pkg/compare/v5.16.0...v5.17.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pkg
22

3-
![Project status](https://img.shields.io/badge/version-5.17.2-green.svg)
3+
![Project status](https://img.shields.io/badge/version-5.18.0-green.svg)
44
[![Lint & Test](https://github.com/go-playground/pkg/actions/workflows/go.yml/badge.svg)](https://github.com/go-playground/pkg/actions/workflows/go.yml)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/pkg/badge.svg?branch=master)](https://coveralls.io/github/go-playground/pkg?branch=master)
66
[![GoDoc](https://godoc.org/github.com/go-playground/pkg?status.svg)](https://pkg.go.dev/mod/github.com/go-playground/pkg/v5)

types/types.go

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package typesext
2+
3+
// Nothing indicates the absence of a value and is an alias to struct{}
4+
type Nothing = struct{}

values/values.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package valuesext
2+
3+
import typesext "github.com/go-playground/pkg/v5/types"
4+
5+
// Nothing is an instantiated value of type typesext.Nothing.
6+
var Nothing = typesext.Nothing{}

0 commit comments

Comments
 (0)