web icon indicating copy to clipboard operation
web copied to clipboard

Sample code is invalid

Open mholt opened this issue 2 years ago • 2 comments

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.

mholt avatar May 11 '23 03:05 mholt

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 avatar May 12 '23 10:05 jschr

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! :)

mholt avatar May 12 '23 22:05 mholt