{"id":50951,"library":"creasty-defaults","title":"Defaults","description":"Package defaults provides a struct tag-based mechanism to set default values for Go struct fields.","status":"active","version":"1.8.0","language":"go","source_language":null,"source_url":"https://github.com/creasty/defaults","tags":["defaults","struct","initialization","configuration"],"install":[{"cmd":"go get github.com/creasty/defaults","lang":"bash","label":"Install github.com/creasty/defaults"}],"dependencies":[],"imports":[{"symbol":"defaults","correct":"github.com/creasty/defaults"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/creasty/defaults\"\n)\n\ntype Config struct {\n\tName string `default:\"guest\"`\n\tPort int    `default:\"8080\"`\n}\n\nfunc main() {\n\tcfg := &Config{}\n\tdefaults.Set(cfg)\n\tfmt.Println(cfg.Name, cfg.Port)\n}","lang":"go","description":"Initialize a struct with default values defined in struct tags."},"warnings":[],"env_vars":null,"search_vec":"'base':9 'configur':22 'default':1,3,13,19 'field':18 'go':16 'initi':21 'mechan':10 'packag':2 'provid':4 'set':12 'struct':6,17,20 'tag':8 'tag-bas':7 'valu':14","created_at":"2026-06-15T05:15:27.051519+00:00","updated_at":"2026-06-15T05:15:27.051519+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/creasty/defaults","github":"https://github.com/creasty/defaults","docs":"https://pkg.go.dev/github.com/creasty/defaults#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["config","utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}