joomcode / errorx

A comprehensive error handling library for Go
MIT License
1.12k stars 29 forks source link

Master is not released, but used in redispipe #17

Closed mwf closed 5 years ago

mwf commented 5 years ago

Hi!

You didn't set any tag for new function errorx.RegisterPrintableProperty and use it in github.com/joomcode/redispipe.

Such behaviour breaks usage of go modules in go1.11+

cd `mktemp -d`
go mod init example.com/test
cat <<EOD > main.go
package main

import (
        _ "github.com/joomcode/redispipe/redis"
)

func main() {}

EOD
go build .

will return

go: finding github.com/joomcode/redispipe/redis latest
# github.com/joomcode/redispipe/redis
/Users/ikorolev/.gvm/pkgsets/go1.11.4/global/pkg/mod/github.com/joomcode/redispipe@v0.9.0/redis/error.go:88:11: undefined: errorx.RegisterPrintableProperty
/Users/ikorolev/.gvm/pkgsets/go1.11.4/global/pkg/mod/github.com/joomcode/redispipe@v0.9.0/redis/error.go:90:10: undefined: errorx.RegisterPrintableProperty
/Users/ikorolev/.gvm/pkgsets/go1.11.4/global/pkg/mod/github.com/joomcode/redispipe@v0.9.0/redis/error.go:92:13: undefined: errorx.RegisterPrintableProperty
/Users/ikorolev/.gvm/pkgsets/go1.11.4/global/pkg/mod/github.com/joomcode/redispipe@v0.9.0/redis/error.go:94:14: undefined: errorx.RegisterPrintableProperty
/Users/ikorolev/.gvm/pkgsets/go1.11.4/global/pkg/mod/github.com/joomcode/redispipe@v0.9.0/redis/error.go:96:15: undefined: errorx.RegisterPrintableProperty
/Users/ikorolev/.gvm/pkgsets/go1.11.4/global/pkg/mod/github.com/joomcode/redispipe@v0.9.0/redis/error.go:100:14: undefined: errorx.RegisterPrintableProperty

This happens because go finds the latest semver tags and put it to go.mod:

cat go.mod
module example.com/test

require (
    github.com/joomcode/errorx v0.1.0 // indirect
    github.com/joomcode/redispipe v0.9.0
)

Could you please make a new release of this lib? That would be enough.

PeterIvanov commented 5 years ago

Thanks for the tip. I've added a release tag just now.

mwf commented 5 years ago

Sorry, @PeterIvanov, you need to prepend version tag with v :) Like v0.8.0

Otherwise go doesn't parse it as a semver ¯\(ツ)

go list -m -versions github.com/joomcode/errorx                                                                                                           
github.com/joomcode/errorx v0.1.0

https://golang.org/cmd/go/#hdr-Module_compatibility_and_semantic_versioning

PeterIvanov commented 5 years ago

Sorry, my bad. Fixed now.

mwf commented 5 years ago

Thanks!