tnsk / environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

environment

şimdilik sadece bu kütüphanede sürekli yazmaktan bıktığım environment kontrolcüsünü ekliyorum ileride eklemeler yapabilirim.


Installation

When used with Go modules, use the following import path:

go get github.com/tnsk/environment

Usage

package main

import (
    "log"
    ec "github/tnsk/environment"
)
func main(){
	if err := ec.Checks([]string{"PATH", "LOG_FILE"}); err != nil {
		log.Fatal(err)
	}
}

Test Result

Valid ENV {"GOPATH", "SHELL"}

Invalid ENV {"GOPATH", "SHELL", "FISTIKCISAHAP"}

=== RUN   TestChecks
=== RUN   TestChecks/Check_Valid
=== RUN   TestChecks/Check_Invalid
--- PASS: TestChecks (0.00s)
    --- PASS: TestChecks/Check_Valid (0.00s)
    --- PASS: TestChecks/Check_Invalid (0.00s)
PASS
ok      github.com/tnsk/environment     (cached)

About

License:MIT License


Languages

Language:Go 100.0%