storage: 🐛 memcache utils.Trim undefined latest release

Using go.mod with:

github.com/gofiber/fiber/v2 v2.38.1
github.com/gofiber/storage/memcache v0.0.0-20221005114327-4e6f1c95ff26

When trying to run I get

# github.com/gofiber/storage/memcache
../go/pkg/mod/github.com/gofiber/storage/memcache@v0.0.0-20221027071415-dca8f183e44b/memcache.go:24:36: undefined: utils.Trim

if I change memcache.go line 23 from serverList := strings.Split(utils.Trim(cfg.Servers, ' '), ",") to serverList := strings.Split(strings.Trim(cfg.Servers, " "), ",") it works.

@efectn mentioned utils.Trim was used for performance on older go versions. It seems that this is broken with the latest goofier release when using go 1.19 in my package however.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I have created 2 new versions https://github.com/gofiber/utils/releases/tag/v2.0.0-beta.1 and https://github.com/gofiber/utils/releases/tag/v1.0.1 with v0.1.2 as source

Can someone check if the new namespace is working https://github.com/gofiber/utils/blob/master/go.mod#L1

module github.com/gofiber/utils/v2

and the errors for the old version are fixed ?

confirmed working using test project https://github.com/sixcolors/gofiber-storage-memcache-modtest

Ok we can change that

I think you’d have to pull the 1.0.0 release and re-release it with the v1 to stop go get -u from upgrading it.

I think v2 would be better for new changes. And we can release v1.0.1 from old v0.1.2 tag

I’m happy with either, since both resolve the issue. ✅

Ok we can change that

I think you’d have to pull the 1.0.0 release and re-release it with the v1 to stop go get -u from upgrading it.

I think v2 would be better for new changes. And we can release v1.0.1 from old v0.1.2 tag

Would be really good if we could find out the cause If the problem is not fixable then gladly with the standard package, but I would find it better to research first to exclude other errors in other packages