Giter Club home page Giter Club logo

Comments (12)

thomasjo avatar thomasjo commented on August 22, 2024

It seems like a built-in function to me: http://golang.org/pkg/builtin/#close

from language-go.

soygul avatar soygul commented on August 22, 2024

Oh totally forgot about that! I was fooled by the fact that you can create a variable named close and it is perfectly ok!

Closing this, as expecting the syntax highlighter to differentiate between a built-in function vs a variable with the name of a built in function is asking a bit too much!

from language-go.

joefitzgerald avatar joefitzgerald commented on August 22, 2024

I don't think it is asking too much to expect that to be differentiated. In one, there is no ( as a suffix; in the other there is a (. Grammars are driven by regular expressions, and this distinction can be made.

from language-go.

soygul avatar soygul commented on August 22, 2024

I didn't inspect the code and I don't know how advanced it is but below is also another consideration if then:

var (
  fn = func() { close(...) }
)

from language-go.

joefitzgerald avatar joefitzgerald commented on August 22, 2024

I would suggest reopening this issue.

from language-go.

soygul avatar soygul commented on August 22, 2024

Ok re-opening this and leaving it up to the project owners to decide.

from language-go.

bassu avatar bassu commented on August 22, 2024

This should be fixed by my latest commit in pull request #34, if it is merged.
It also marks these builtin functions' args as data types (just like what Emacs does)!

solarized-dark-bold-go-builtinfuncs

from language-go.

svanharmelen avatar svanharmelen commented on August 22, 2024

Yup... Looks as solved to me as well...

from language-go.

soygul avatar soygul commented on August 22, 2024

Didn't solve my specific case (see below) but still a good improvement.

image

from language-go.

svanharmelen avatar svanharmelen commented on August 22, 2024

Check... Personally I do wonder if this is actually something that you would want. Syntactically your right, but if it will improve readability...?

Next to that it's of course a better practice to _not_ make shadow variables over built-in names/types/functions

from language-go.

soygul avatar soygul commented on August 22, 2024

Ok gave this a second thought and a fix for this would actually decrease the readability. Otherwise it would be necessary to use a 3rd color to indicate shadowed variables to be spot on with what's going on.

Leaving it up to maintainers to close this as they like. I would consider this solved now.

from language-go.

svanharmelen avatar svanharmelen commented on August 22, 2024

This is fixed in PR #58 and released in v0.36.0

from language-go.

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.