{"id":16800233,"url":"https://github.com/abiosoft/goutils","last_synced_at":"2025-06-30T16:35:57.609Z","repository":{"id":33393167,"uuid":"37038202","full_name":"abiosoft/goutils","owner":"abiosoft","description":"A set of utilities for Go","archived":false,"fork":false,"pushed_at":"2016-03-02T19:36:39.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T14:49:53.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abiosoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-08T00:39:40.000Z","updated_at":"2016-03-03T07:24:32.000Z","dependencies_parsed_at":"2022-07-16T07:47:00.341Z","dependency_job_id":null,"html_url":"https://github.com/abiosoft/goutils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fgoutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fgoutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fgoutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fgoutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abiosoft","download_url":"https://codeload.github.com/abiosoft/goutils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976362,"owners_count":20377691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T09:31:45.098Z","updated_at":"2025-03-17T05:20:27.895Z","avatar_url":"https://github.com/abiosoft.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goutils\n\nA set of personal utilities for Go.\n\n[![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/abiosoft/goutils)\n[![Build Status](https://drone.io/github.com/abiosoft/goutils/status.png)](https://drone.io/github.com/abiosoft/goutils/latest)\n[![Coverage Status](https://coveralls.io/repos/abiosoft/goutils/badge.svg)](https://coveralls.io/r/abiosoft/goutils)\n\nI will keep adding more packages as time goes on and the need arises.\n\n### Packages\n\n#### 1. Set\n\n[![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/abiosoft/goutils/set)\n\n##### Example\n```go\nimport \"github.com/abiosoft/goutils/set\"\n\ns := set.New()\n\n// stores distinctly, repetitions have no effect.\ns.AddAll(1, 1, 2, 2, 3, 6, 2, 1, \"a\", \"b\", \"a\")\n\ns.Size() // 6\n\nlist := []interface{}{1, 2, 3, 6, \"a\", \"b\"}\ns.ContainsList(list) // true\n\niter := s.Iterator()\nfor iter.HasNext() {\n    // do something with iter.Value()\n    ...\n}\n```\n\n#### 2. Environment Variables\n\n[![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/abiosoft/goutils/env)\n\n##### Example\n```go\nimport \"github.com/abiosoft/goutils/env\"\n\nvar vars env.EnvVar\n\n// set key and val\nvars.Set(\"GOPATH\", \"$HOME/go\")\n// or set as a full string\nvars.SetStr(\"GOPATH=$HOME/go\")\n// get\nvars.Get(\"GOPATH\") // $HOME/go\n\nvars.Set(\"GOOS\", \"darwin\")\nvars.Get(\"GOOS\") // darwin\nvars.String() // GOPATH=$HOME/go\\nGOOS=darwin\n\n// though env.EnvVar is a slice, adding an invalid string has no effect.\nvars = append(vars, \"SOME STRING\")\nvars.SetStr(\"SOME STRING\")\nvars.String() // GOPATH=$HOME/go\\nGOOS=darwin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiosoft%2Fgoutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabiosoft%2Fgoutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiosoft%2Fgoutils/lists"}