Coder Social home page Coder Social logo

Comments (8)

hexdigest avatar hexdigest commented on May 21, 2024 1

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.

cheshir avatar cheshir commented on May 21, 2024 1

Hm, you were perfectly right. I had the wrong version. With the v1.1.10 everything works well with the Import directive.

from gowrap.

hexdigest avatar hexdigest commented on May 21, 2024

@kop can you please try v1.1.10 with {{.Import}} template helper and without it?

from gowrap.

cheshir avatar cheshir commented on May 21, 2024

@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.

cheshir avatar cheshir commented on May 21, 2024

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.

hexdigest avatar hexdigest commented on May 21, 2024

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.

hexdigest avatar hexdigest commented on May 21, 2024

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.

cheshir avatar cheshir commented on May 21, 2024

@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)

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.