GithubHelp home page GithubHelp logo

Comments (14)

LyricTian avatar LyricTian commented on August 17, 2024

Try to update the package:go get -u -v github.com/satori/go.uuid

from oauth2.

beng90 avatar beng90 commented on August 17, 2024

It won't help.
Must() function require two parameters and satori still has the same in implementation.
https://github.com/satori/go.uuid/blob/36e9d2ebbde5e3f13ab2e25625fd453271d6522e/uuid.go#L156

I can fix it in oauth2 package but I don't know how to contribute.

from oauth2.

beng90 avatar beng90 commented on August 17, 2024

@LyricTian could you do the change in code. This is simple fix.
I can prepare Pull request if you set me as contributor.

from oauth2.

LyricTian avatar LyricTian commented on August 17, 2024

You can try to update the package:

go get -v -u github.com/satori/go.uuid
go get -v -u gopkg.in/oauth2.v3

I have found no problems with my use here.

// NewV4 returns random generated UUID.
func NewV4() (UUID, error) {
	return global.NewV4()
}
func Must(u UUID, err error) UUID {
	if err != nil {
		panic(err)
	}
	return u
}

from oauth2.

adamdecaf avatar adamdecaf commented on August 17, 2024

@LyricTian I'm trying with go modules and getting the same error.

https://github.com/go-oauth2/oauth2/blob/v3.8.12/store/token.go#L46
https://github.com/satori/go.uuid/blob/v1.2.0/uuid.go#L156

Those are the latest tags so go mod picks them both up.

from oauth2.

LyricTian avatar LyricTian commented on August 17, 2024

OK,I have removed the package:github.com/satori/go.uuid.You try again:
go get -v -u gopkg.in/oauth2.v3

from oauth2.

beng90 avatar beng90 commented on August 17, 2024

It's much better but I still see one bug
vendor/gopkg.in/go-oauth2/redis.v1/token.go:44:23: not enough arguments in call to uuid.Must have (uuid.UUID) want (uuid.UUID, error)

When function require 2 parameters we cannot pass just one even when it can be nil

from oauth2.

LyricTian avatar LyricTian commented on August 17, 2024

OK.You try again:go get -u -v gopkg.in/go-oauth2/redis.v3

from oauth2.

beng90 avatar beng90 commented on August 17, 2024

It is the other bug
not enough arguments in call to manager.MustTokenStorage have (*"vendor/gopkg.in/go-oauth2/redis.v3".TokenStore) want (oauth2.TokenStore, error)

Example usage:
manager.MustTokenStorage(redis.NewRedisStore(&redis.Options{ Addr: config.Redis.Host + ":" + strconv.Itoa(config.Redis.Port), }))

NewRedisStore returns different than NewTokenStore in redis.v1

from oauth2.

LyricTian avatar LyricTian commented on August 17, 2024

you can try MapTokenStorage

from oauth2.

adamdecaf avatar adamdecaf commented on August 17, 2024

@LyricTian Thanks for the fixes. Could we get a bugfix release tagged for go modules?

from oauth2.

LyricTian avatar LyricTian commented on August 17, 2024

Yes, what do I need to do?

from oauth2.

adamdecaf avatar adamdecaf commented on August 17, 2024

I bumped my project to v3.9.0 and it worked, thanks!

from oauth2.

ptman avatar ptman commented on August 17, 2024

so this is done and could be closed?

from oauth2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.