Git Product home page Git Product logo

Comments (2)

viguza avatar viguza commented on May 27, 2024

Hi @fatih, I have been messing around with this repo and also with https://github.com/fatih/structtag, and I also noticed this issue.

I was about to do my contribution with the 2 improvements you suggested, but then I got stuck. Right now if the tag can't be parsed the error is just returned and the next fields are ignored. However, if you continue with the other fields instead of failing directly, it's possible to find more fields with malformed tags, which is going to generate more errors.

As I see it, there are 2 ways to handle that:

  1. Return an array of errors, where each error represents a malformed tag. Then, on main just loop that array and print each message on a new line.

  2. Generate a big single error message with all the malformed tags lines and continue returning just a single error.

IMHO, the first option looks much better than the second one. I just wanted to know if you have any other possible solution in mind to tackle this?

from gomodifytags.

fatih avatar fatih commented on May 27, 2024

@viguza Thank for looking into this. I had alrady some changes in my local branch as I think it's kinda hard to get it right. The current implementation continues to process all fields but returns a list of errors if the format mode is set to json.

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.