diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-19 05:53:29 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-19 05:53:29 -0400 |
commit | 258aa565321493fbf6b4325d7b00dbb2058d646a (patch) | |
tree | fa315f150950867a07ddd7536f102ddc666ec2d8 /util.go | |
parent | 83f436e175643da6d75e1de3fe905b586012bac2 (diff) |
Split up go code into multiple files
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) + } +} |