Git Product home page Git Product logo

Comments (4)

fatih avatar fatih commented on May 27, 2024

Hi @zhaogaolong,

Thanks for the feedback. You can already do this via gomodifytag. Not sure which editor you use, but you can pass --transform indidvidually. Here is a demo:

$  cat demo.go
package main

type Foo struct {
        MyExample             int 
        AppDeploymentConfigID int 
}

$ gomodifytags -file demo.go -line 3,6 -add-tags json -transform camelcase -w
package main

type Foo struct {
        MyExample             int `json:"myExample"`
        AppDeploymentConfigID int `json:"appDeploymentConfigID"`
}

$ gomodifytags -file demo.go -line 3,6 -add-tags gorm -transform snakecase -w
package main

type Foo struct {
        MyExample             int `json:"myExample" gorm:"my_example"`
        AppDeploymentConfigID int `json:"appDeploymentConfigID" gorm:"app_deployment_config_id"`
}

Closing this because it's possible already. Let me know if this doesn't solve your problem. Thanks

from gomodifytags.

zhaogaolong avatar zhaogaolong commented on May 27, 2024

Hi @fatih
I know this two command can solve my problem,but i want perfect solution like:

 gomodifytags -file demo.go -line 3,6 -add-tags json -transform camelcase  -add-tags gorm -transform snakecase -w

merge two commands . It feels better.

from gomodifytags.

fatih avatar fatih commented on May 27, 2024

Hi @zhaogaolong

The syntax you mentioned is not clear and open to errors. I don't want to extend it and complicate the tool. The current one approach is simple enough and does the work. Thanks again for your feedback.

from gomodifytags.

zhaogaolong avatar zhaogaolong commented on May 27, 2024

Hi @fatih
I know you meaning, have diffrent kind tag is ugly design and isn't clear. useing same kind tag well be better. Thanks again.

from gomodifytags.

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.