diff options
Diffstat (limited to 'util.go')
-rw-r--r-- | util.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1,7 +1,23 @@ package main +import ( + "net/url" +) + func Assert(cond bool, msg string) { if !cond { panic(msg) } } + +func IsRemote(filename string) bool { + u, err := url.Parse(filename) + check(err) + return u.IsAbs() +} + +func check(e error) { + if e != nil { + panic(e) + } +} |