Code Monkey home page Code Monkey logo

Comments (12)

andydotxyz avatar andydotxyz commented on July 22, 2024 1

(but we don't run anything like that on our documentation pages)

from fyne.

andydotxyz avatar andydotxyz commented on July 22, 2024 1

Ah yes. This does not actually print to the docs site, just generates images.
But I have fixed it for good measure.

from fyne.

Jacalz avatar Jacalz commented on July 22, 2024

This is not a breaking change because you are supposed to name the fields you set. Many code analysers even give you an error when you have unnamed struct parameters. If this was considered a breaking change, we would never be able to improve the types without introducing a new type i.e. every little improvement would be a breaking change. I will close this as not being an issue.

from fyne.

codesoap avatar codesoap commented on July 22, 2024

I see. Thanks for evaluating.

from fyne.

Jacalz avatar Jacalz commented on July 22, 2024

No worries. Thanks for keeping a close eye on the codebase

from fyne.

andydotxyz avatar andydotxyz commented on July 22, 2024

The OP is right it does feel like something broke (though I agree its not a breaking change).
What we may need to do however is to ensure any usage of struct literals in our codebase all use named fields ;).

from fyne.

Jacalz avatar Jacalz commented on July 22, 2024

What we may need to do however is to ensure any usage of struct literals in our codebase all use named fields ;).

I think Staticheck already flags that.

from fyne.

Jacalz avatar Jacalz commented on July 22, 2024

Yup. We should probably move the examples out into separate files (whose contents are added into the code blocks) and run code analysis on them?

from fyne.

codesoap avatar codesoap commented on July 22, 2024

JFYI: I did a quick grep with the expression \.[A-Z][a-zA-Z]*\{[^:}]+\} in the docs repo and only found some relevant results with color.NRGBA, color.Gray and color.RGBA in these files:

  • _gen/genlayouts.go
  • canvas/circle.md
  • canvas/raster.md

I'm not sure, though, if these really need to be changed. I don't know what the policy about adding new fields to structs is in the standard library, but doubt that these three structs will ever change.

from fyne.

andydotxyz avatar andydotxyz commented on July 22, 2024

Thanks so much for that. We should fix them anyway, as @Jacalz said it's something linters complain about so our docs should this best practice!

from fyne.

andydotxyz avatar andydotxyz commented on July 22, 2024

Those instances should be fixed now :)

from fyne.

codesoap avatar codesoap commented on July 22, 2024

@andydotxyz canvas/circle.md and canvas/raster.md look good to me. In _gen/genlayouts.go I still see the "old" style in line 29 and line 32.

from fyne.

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.