{"id":13411681,"url":"https://github.com/StudioSol/set","last_synced_at":"2025-03-14T17:31:02.304Z","repository":{"id":33979790,"uuid":"141761192","full_name":"StudioSol/set","owner":"StudioSol","description":"A simple Set data structure implementation in Go (Golang) using LinkedHashMap.","archived":false,"fork":false,"pushed_at":"2022-09-08T12:30:35.000Z","size":18,"stargazers_count":26,"open_issues_count":1,"forks_count":11,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-07-31T20:48:36.584Z","etag":null,"topics":["data-structures","go","golang","hacktoberfest","linked-hashmap","set"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StudioSol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-20T21:53:37.000Z","updated_at":"2024-07-17T14:15:58.000Z","dependencies_parsed_at":"2022-08-22T18:31:17.021Z","dependency_job_id":null,"html_url":"https://github.com/StudioSol/set","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StudioSol","download_url":"https://codeload.github.com/StudioSol/set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243618656,"owners_count":20320272,"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":["data-structures","go","golang","hacktoberfest","linked-hashmap","set"],"created_at":"2024-07-30T20:01:15.719Z","updated_at":"2025-03-14T17:31:01.896Z","avatar_url":"https://github.com/StudioSol.png","language":"Go","readme":"## Set\n\n[![Build Status](https://travis-ci.org/StudioSol/set.svg?branch=master)](https://travis-ci.org/StudioSol/set)\n[![codecov](https://codecov.io/gh/StudioSol/set/branch/master/graph/badge.svg)](https://codecov.io/gh/StudioSol/set)\n[![Go Report Card](https://goreportcard.com/badge/github.com/StudioSol/set)](https://goreportcard.com/report/github.com/StudioSol/set)\n[![GoDoc](https://godoc.org/github.com/StudioSol/set?status.svg)](https://godoc.org/github.com/StudioSol/set)\n\nSet is a simple Set data structure implementation in Go (Golang) using LinkedHashMap.\n\nThis library allow you to get a set of `int64` or `string` without duplicated items.\n\n### Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/StudioSol/set\"\n)\n\nfunc main() {\n\tduplicatedInt64 := []int64{1, 1, 2, 2, 3, 3}\n\n\tunduplicatedInt64 := set.NewLinkedHashSetINT64(duplicatedInt64...)\n\n\t// Get a []int64 from set\n\tunduplicatedArray := unduplicatedInt64.AsSlice()\n\tfmt.Println(unduplicatedArray) // will print [1 2 3]\n\n\t// Get the Length from set\n\tfmt.Println(unduplicatedInt64.Length()) // will print 3\n\n\t// Add new items in set\n\tunduplicatedInt64.Add(1, 2, 3, 4)\n\tfmt.Println(unduplicatedInt64.AsSlice()) // will print [1 2 3 4]\n\n\t// Check if item is in set\n\tfmt.Println(unduplicatedInt64.InArray(1)) // will print true\n\tfmt.Println(unduplicatedInt64.InArray(5)) // will print false\n\n\t// Get a []interface{} from set\n\tinterfaceList := unduplicatedInt64.AsInterface()\n\tfmt.Println(interfaceList) // will print [1 2 3 4]\n\n\t// Allow to iter over set\n\tfor i := range unduplicatedInt64.Iter() {\n\t\tfmt.Println(i)\n\t}\n\n\t// Remove items from set\n\tunduplicatedInt64.Remove(0, 1, 2, 3)\n\tfmt.Println(unduplicatedInt64.AsSlice()) // will print [4]\n}\n\n// You have same methods to LinkedHashSetString\n```\n","funding_links":[],"categories":["Data Integration Frameworks","数据结构与算法","Data Structures and Algorithms","Data Structures","Generators","数据结构`go语言实现的数据结构与算法`","Uncategorized","数据结构"],"sub_categories":["Sets","集","Advanced Console UIs","标准 CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStudioSol%2Fset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStudioSol%2Fset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStudioSol%2Fset/lists"}