1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/util.go

24 lines
260 B
Go
Raw Normal View History

2018-05-19 05:38:51 -04:00
package main
2018-05-19 05:53:29 -04:00
import (
"net/url"
)
2018-05-19 05:56:02 -04:00
func assert(cond bool, msg string) {
2018-05-19 05:38:51 -04:00
if !cond {
panic(msg)
}
}
2018-05-19 05:53:29 -04:00
2018-05-19 05:56:02 -04:00
func isRemote(filename string) bool {
2018-05-19 05:53:29 -04:00
u, err := url.Parse(filename)
check(err)
return u.IsAbs()
}
func check(e error) {
if e != nil {
panic(e)
}
}