Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample code is invalid #261

Open
mholt opened this issue May 11, 2023 · 2 comments
Open

Sample code is invalid #261

mholt opened this issue May 11, 2023 · 2 comments
Labels

Comments

@mholt
Copy link

mholt commented May 11, 2023

The Go sample code doesn't compile:

struct config {
    port int
}

func main() {
    var cfg config

    flag.IntVar(&cfg.port, "port", 4000)
    flag.Parse()

    // Start the web server.
    addr := fmt.Printf(":%d", cfg.port)
    log.Fatal(http.ListenAndServe(addr, nil))
}

The type definition (the first line) should be:

type config struct {

Where is the sample code from? I tried to submit a patch but couldn't trace it down.

@jschr
Copy link
Member

jschr commented May 12, 2023

Thanks for pointing this out.

The templates are in a different repo that I’ve been procrastinating on cleaning up, unfortunately. I hope to make it easier for others to contribute in the future.

Changing the language template requires I re-sync all themes so it will be a little bit before I get this fixed but will try ASAP.

@jschr jschr added the bug label May 12, 2023
@mholt
Copy link
Author

mholt commented May 12, 2023

No worries, I just got lost trying to follow the text back to where it lives. Didn't realize it had to re-sync all themes. Not a top priority. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants