Cannot claim package

Hey, I’m trying to register a module to caddy v2.

@matt it shows unable to scan modules in package

error id: 97efdef0-c253-4a48-8919-fc638e84cb1d

1 Like

Ah, it’s because of this line:

caddy.RegisterModule(&Upstreams{})

Our code analyzer is a bit opinionated and requires either a composite literal (i.e. remove the &) or the use of new() instead of the & notation):

unexpected argument to RegisterModule(): &ast.UnaryExpr{OpPos:29911713, Op:17, X:(*ast.CompositeLit)(0xc0236a2440)} - expect either composite literal or new()

Looks like a useful plugin!! Thanks for making it and sharing it.

3 Likes

I saw that @matt already solved the issue. I just wanted to come in and say that this is a really interesting plugin and looks like it can be really useful.

Thanks for sharing it!

3 Likes

Thank you!

This topic was automatically closed after 30 days. New replies are no longer allowed.