Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorspf13 <steve.francia@gmail.com>2013-10-10 02:52:29 +0400
committerspf13 <steve.francia@gmail.com>2013-10-10 02:53:46 +0400
commit0318f7c149f98eb2bcbb44b0ca1c7420379190eb (patch)
treeb5e50ef3e6853658a5af3f530f89e3276939f99b /utils
parente6ace71fecd075b96aa81b8daa3f3c368f27325f (diff)
Clean up server & build site logic. Fixed #94
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/utils.go b/utils/utils.go
new file mode 100644
index 000000000..641abfeb2
--- /dev/null
+++ b/utils/utils.go
@@ -0,0 +1,22 @@
+package utils
+
+import (
+ "log"
+ "os"
+)
+
+func CheckErr(err error, s ...string) {
+ if err != nil {
+ for _, message := range s {
+ log.Fatalf(message)
+ }
+ log.Fatalf("Fatal Error: %v", err)
+ }
+}
+
+func CheckErrExit(err error, s ...string) {
+ if err != nil {
+ CheckErr(err, s...)
+ os.Exit(-1)
+ }
+}