hhkbp2/go-logging

`go get` error when using Go Modules

Closed this issue · 4 comments

When running go get with Go Modules enabled, 4 errors are reported.

NOTE: E:\GoCodes is just my GOPATH.

E:\GoCodes\pkg\mod\github.com\hhkbp2\go-logging@v0.2.5\gen-go\logging\thriftloggingservice.go:77:20: not enough arguments in call to oprot.Flush
        have ()
        want (context.Context)
E:\GoCodes\pkg\mod\github.com\hhkbp2\go-logging@v0.2.5\gen-go\logging\thriftloggingservice.go:101:31: cannot use &thriftLoggingServiceProcessorReport literal (type *thriftLoggingServiceProcessorReport) as type thrift.TProcessorFunction in assignment:
        *thriftLoggingServiceProcessorReport does not implement thrift.TProcessorFunction (wrong type for Process method)
                have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
                want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
E:\GoCodes\pkg\mod\github.com\hhkbp2\go-logging@v0.2.5\gen-go\logging\thriftloggingservice.go:111:27: not enough arguments in call to processor.Process
        have (int32, thrift.TProtocol, thrift.TProtocol)
        want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)
E:\GoCodes\pkg\mod\github.com\hhkbp2\go-logging@v0.2.5\gen-go\logging\thriftloggingservice.go:119:13: not enough arguments in call to oprot.Flush
        have ()
        want (context.Context)

Upon further inspection, it seems to be an incompatibility with git.apache.org/thrift.git@v0.12.0.
Might need to go back to using non-Modules for now...

Hi @markvincentcaro

Please notice

  1. The 0.2.5 version is quite old. The thrift handler was moved to the branch thrift-hanlder already but no new release was made. You should check out the latest master branch.
  2. Go Modules is not supported yet. I will take a look into adding support for it later.

Hi, @hhkbp2
Yeah, I guess it's much too early to start using Go Modules for now.
I think I'll wait a few more years until it becomes the norm.
Many thanks for replying!

Hi @markvincentcaro

I added the mod files to support go module. You could check out the latest master code and use go module commands. Thanks.