Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/codingconcepts/env
Tag-based environment configuration for structs.
$ go get -u github.com/codingconcepts/env
package main
import (
"fmt"
"log"
"time"
"github.com/codingconcepts/env"
)
type config struct {
Secret []byte `env:"SECRET" required:"true"`
Region string `env:"REGION"`
Port int `env:"PORT" required:"true"`
Peers []string `env:"PEERS"` // you can use `delimiter` tag to specify separator, for example `delimiter:" "`
ConnectionTimeout time.Duration `env:"TIMEOUT" default:"10s"`
}
func main() {
c := config{}
if err := env.Set(&c); err != nil {
log.Fatal(err)
}
...
}
$ ID=1 SECRET=shh PORT=1234 PEERS=localhost:1235,localhost:1236 TIMEOUT=5s go run main.go
bool
and []bool
string
and []string
[]byte
int
, int8
, int16
, int32
, int64
, []int
, []int8
, []int16
, []int32
, and []int64
uint
, uint8
, uint16
, uint32
, uint64
, []uint
, []uint8
, []uint16
, []uint32
, and []uint64
float32
, float64
, []float32
, and []float64
time.Duration
and []time.Duration
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.