{"id":20007529,"url":"https://github.com/shamsher31/gostack","last_synced_at":"2025-03-02T01:18:57.053Z","repository":{"id":57591148,"uuid":"52770056","full_name":"shamsher31/gostack","owner":"shamsher31","description":"gostack is heterogeneous stack which allows you to store any type of value.","archived":false,"fork":false,"pushed_at":"2016-07-14T10:58:21.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T14:13:10.959Z","etag":null,"topics":["golang","package","stack"],"latest_commit_sha":null,"homepage":"","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/shamsher31.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":"2016-02-29T06:42:01.000Z","updated_at":"2016-02-29T09:12:49.000Z","dependencies_parsed_at":"2022-09-26T19:43:07.919Z","dependency_job_id":null,"html_url":"https://github.com/shamsher31/gostack","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/shamsher31%2Fgostack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamsher31%2Fgostack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamsher31%2Fgostack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamsher31%2Fgostack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shamsher31","download_url":"https://codeload.github.com/shamsher31/gostack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241444191,"owners_count":19963760,"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":["golang","package","stack"],"created_at":"2024-11-13T06:16:59.095Z","updated_at":"2025-03-02T01:18:57.025Z","avatar_url":"https://github.com/shamsher31.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gostack\n\n[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/shamsher31/gostack)\n[![Build Status](https://travis-ci.org/shamsher31/gostack.svg)](https://travis-ci.org/shamsher31/gostack)\n[![GitHub release](http://img.shields.io/github/release/shamsher31/gostack.svg?style=flat-square)](release)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](license)\n\nThis package implements heterogeneous stack which allows you to store any type of value\nas compared to the built-in slice and maps which will only allow specific types. Its a thread safe so it works pretty well with multiple goroutines.  \n\n### How to install\n```go\ngo get github.com/shamsher31/gostack\n```\n\n### How to use\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/shamsher31/gostack\"\n)\n\nfunc main() {\n  // Declare new stack\n  var myStack stack.Stack\n\n  fmt.Println(\"Stack is empty : \", myStack.IsEmpty())\n\n  //Push some elements of different types in Stack\n  myStack.Push(10)\n  myStack.Push([]string{\"Shamsher\", \"Ansari\"})\n  myStack.Push(13.5)\n  myStack.Push(\"My Awesome stack\")\n\n  fmt.Println(\"Elements of stack : \", myStack)\n\n  fmt.Println(\"Stack is empty : \", myStack.IsEmpty())\n\n  if myStack.IsEmpty() == false {\n    fmt.Println(\"Total elements in stack : \", myStack.Len())\n  }\n\n  top, err := myStack.Top()\n  if err != nil {\n    fmt.Println(err)\n  }\n  fmt.Println(\"Top of the stack : \", top)\n\n  elem, err := myStack.Pop()\n  if err != nil {\n    fmt.Println(err)\n  }\n  fmt.Println(\"Poped element : \", elem)\n  fmt.Println(\"Elements of stack : \", myStack)\n}\n```\n### Why\nThis package is born while learning and experimenting with golang to understand how pointers, mutual exclusion locks and interface works together. \n\n### License\nMIT © [Shamsher Ansari](https://github.com/shamsher31)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamsher31%2Fgostack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshamsher31%2Fgostack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamsher31%2Fgostack/lists"}