tobgu / peds

Type safe persistent/immutable data structures for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pointer type parameters

anacrolix opened this issue · comments

I have a go generate command in some code of the form:

//go:generate peds -maps entryHandlesMap<Entry,handles> -sets handles<*EntryHandle> -pkg=conntrack -file=peds.go

The *EntryHandle type parameter seems to be the cause of the issue: I get this error, running go generate on the containing package:

$ go generate
Error: Invalid set specification: handles<*EntryHandle>

Generate statically type safe code for persistent data structures.

USAGE
peds

FLAGS        EXAMPLE
  -file      path/to/file.go
  -imports   import1;import2
  -maps      Map1<int,string>;Map2<float,int>
  -pkg       package_name
  -sets      Set1<int>
  -vectors   Vec1<int>

instance.go:14: running "peds": exit status 1

Thanks for reporting, I suspect you are right. Will look into it (if you want to issue a PR with a fix that's also OK! :-)).

I think I might have a PR soon.

Just saw #3 that solved it the same way I did. Could you merge that?

Yes, done!