Before using LiveWire, JavaScript was always the language used for both frontend and backend development. When choosing a framework, one of the most important factors to consider is validation.
Validation is a crucial and time-consuming aspect of development. It needs to be performed on the frontend, backend, and when modifying the database through input, update, or delete operations. In some cases, the validation process may be performed twice. Typically, the backend performs validation using the same language.
use github.com/spf13/viper Get env data
config.go
type urls struct { Demo1 string `mapstructure:"demo1"` Demo2 string `mapstructure:"demo2"` } type NotifyHttps struct { Name string `mapstructure:"name"` Token string `mapstructure:"token"` Urls urls `mapstructure:"urls"` } type env struct { NotifyHttp NotifyHttps `mapstructure:"notify_https"` } .env
notify_https: name: order_comfire token: 123456abcdef urls: demo1: localhost:8888 demo2: localhost:8443 notify.go
refUrls := reflect.ValueOf(config.Env.NotifyHttps.Urls) urlNum := refUrls.NumField() for i := 0; i < urlNum; i++ { url := refUrls.Field(i).String() if url !
https://github.com/ZLMediaKit/ZLMediaKit
https://github.com/q191201771/lal
https://521dimensions.notion.site/VPS-Benchmarks-for-Self-hosters-c6eca7c5f16d4bb8aeb989174fc58ffe.
Hetzner Cloud
prohosting24 https://prohosting24.net/genoa 這間評價可,高防、效能不錯,無限流量,但用太多會限流,或是被踢掉,不能有法
https://play.golang.com/p/BPWVd0WAfqR
package main import ( "encoding/json" "fmt" ) var bodyA = []byte(`{ "type": "A", "data": { "name": "Johnny" } }`) var bodyB = []byte(`{ "type": "B", "data": { "nickname": "J." } }`) type TypeA struct { Name string `json:"name"` } type TypeB struct { Nickname string `json:"nickname"` } func main() { req := struct { Type string `json:"type"` Data any `json:"data"` }{} err := json.Unmarshal(bodyA, &req) // bodyB if err !