summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'util.go')
-rw-r--r--util.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/util.go b/util.go
index 851ee3475..803260920 100644
--- a/util.go
+++ b/util.go
@@ -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)
+ }
+}