Comments (8)
But I can't prove it
$ md5sum `which gowrap`
$ curl https://github.com/hexdigest/gowrap/releases/download/v1.1.10/gowrap_1.1.10_Linux_x86_64.tar.gz -L -o /tmp/gowrap.tar.gz && cd /tmp/ && tar zxvf gowrap.tar.gz && md5sum /tmp/gowrap
If hashes are different then you use outdated version (correct the above curl for your platform)
from gowrap.
Hm, you were perfectly right. I had the wrong version. With the v1.1.10 everything works well with the Import directive.
from gowrap.
@kop can you please try v1.1.10 with {{.Import}} template helper and without it?
from gowrap.
@hexdigest I've got error with {{ .Import }}
template: body:5:5: executing "body" at <.Import>: can't evaluate field Import in type generator.TemplateInputs
from gowrap.
Anyway, it could be great to use common templates without patching it due to the several packages.
In my case I have interface Foo in package "domain.com/proto/service/v1/sub" and package name "service".
Right now gowrap generates me:
type FooWithPrometheus struct {
base service.Foo
and it's the code I want but there is no import.
from gowrap.
Hi @cheshir ! Thanks for testing this. I think you're gowrap binary is not up to date.
The error you're getting basically says that there's no Import method.
Can you please update gowrap and try again?
from gowrap.
Anyway, it could be great to use common templates without patching it due to the several packages.
I agree with this we have to update common templates and use this new {{.Import}} helper everywhere.
from gowrap.
@hexdigest thanks for the fast response!
I'm pretty sure I'm using v1.1.10 version. But I can't prove it :) It would be helpful to have something like --version flag.
from gowrap.
Related Issues (20)
- Plugin for goland or another IDE HOT 1
- Unable to generate if destination directory does not contain go files HOT 1
- Allowing specifying custom package HOT 6
- Wrong position of package comment if template has no own `import` HOT 2
- Cannot iterate over m.Params names HOT 1
- comments on the top of generated file HOT 2
- Unable to install this package HOT 3
- Add Masterminds/sprig template functions HOT 1
- method.Declaration does not add package names in argument types and return types HOT 5
- gowrap version cmd
- .Interface.Methods no longer contains nested methods HOT 2
- Appear in Nixpkgs HOT 1
- Add support for build tags HOT 1
- Add support for internal packages HOT 2
- template path in generated code uses OS specific path separators HOT 1
- Method.ReturnsError is not a proper interface/implements check
- Merge generated file with existing instead of overwriting
- Can't loading template during the gen
- "Redeclared as the imported package name" error when main module and one of dependencies have the same last part HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gowrap.