Skip to content

Commit 2ff27f9

Browse files
author
Dean Karn
authored
correct Link Error output missing err when prefix not set (#21)
1 parent 81fde8d commit 2ff27f9

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9-
## [5.3.1] - 2023-08-16
9+
## [5.3.2] - 2023-08-16
10+
### Fixed
11+
- Link Error output missing error when prefix was blank.
12+
13+
## [5.3.1] - 2023-08-15
1014
### Fixed
1115
- Wrap recursively wrapping the Chain itself instead of only adding another Link.
1216

@@ -37,7 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3741
- Updated deps.
3842

3943

40-
[Unreleased]: https://github.com/go-playground/errors/compare/v5.3.1...HEAD
44+
[Unreleased]: https://github.com/go-playground/errors/compare/v5.3.2...HEAD
45+
[5.3.2]: https://github.com/go-playground/errors/compare/v5.3.1...v5.3.2
4146
[5.3.1]: https://github.com/go-playground/errors/compare/v5.3.0...v5.3.1
4247
[5.3.0]: https://github.com/go-playground/errors/compare/v5.2.3...v5.3.0
4348
[5.2.3]: https://github.com/go-playground/errors/compare/v5.2.2...v5.2.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package errors
22
============
3-
![Project status](https://img.shields.io/badge/version-5.3.1-green.svg)
3+
![Project status](https://img.shields.io/badge/version-5.3.2-green.svg)
44
[![Build Status](https://travis-ci.org/go-playground/errors.svg?branch=master)](https://travis-ci.org/go-playground/errors)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/errors)](https://goreportcard.com/report/github.com/go-playground/errors)
66
[![GoDoc](https://godoc.org/github.com/go-playground/errors?status.svg)](https://pkg.go.dev/github.com/go-playground/errors/v5)

chain.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ func (l *Link) formatError(b []byte) []byte {
107107

108108
if l.Prefix != "" {
109109
b = append(b, l.Prefix...)
110+
}
110111

111-
if l.Err != nil {
112+
if l.Err != nil {
113+
if l.Prefix != "" {
112114
b = append(b, ": "...)
113-
b = append(b, l.Err.Error()...)
114115
}
116+
b = append(b, l.Err.Error()...)
115117
}
116118

117119
for _, tag := range l.Tags {

0 commit comments

Comments
 (0)