[go-nuts] Re: template Funcs with ParseFile and Execute

2017-03-27 Thread Lee McLoughlin
Perhaps I'm missing something in the documentation but I think this shows something odd happening when the name in New() and the first filename in ParseFiles() do not match: package main import ( "fmt" "html/template" "log" "os" ) // x.tpl contains just one line

[go-nuts] template Funcs with ParseFile and Execute

2017-03-26 Thread Lee McLoughlin
Try changing the call to New to name the template the same as the first parameter to ParseFiles t, _ := template.New(templates.BASE).Funcs(funcMap).ParseFiles(templates.BASE, templates.NOTIFICATIONS, templates.TICKER, templateName) There is something odd about how ParseFiles works if the name i

[go-nuts] Re: Network error handle

2016-12-10 Thread Lee McLoughlin
On a Dial error conn will be nil. Remove the call to conn.Close() On Saturday, 10 December 2016 23:28:36 UTC, Stannis Kozlov wrote: > > I'm trying to write simple port scanner and using "net" to check port > availability: > func sock() { > conn, err := net.Dial("tcp", "192.168.0.1:9991") > if