https://github.com/sbueschel/go-linked
Doubly linked list for Go (with generics)
https://github.com/sbueschel/go-linked
data-structures generics go golang linked-list
Last synced: 8 days ago
JSON representation
Doubly linked list for Go (with generics)
- Host: GitHub
- URL: https://github.com/sbueschel/go-linked
- Owner: sbueschel
- License: mit
- Created: 2025-06-20T21:55:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-11T16:35:41.000Z (11 months ago)
- Last Synced: 2025-08-11T18:33:28.036Z (11 months ago)
- Topics: data-structures, generics, go, golang, linked-list
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# linked - Generic Linked List
`linked` is a package implementing a doubly linked list for Go.

[](https://pkg.go.dev/github.com/sbueschel/go-linked)
## Features
- **No dependencies**: zero 3rd party dependencies.
- **Generics**: no need to use `any` or `interface{}` (unless you really want to).
- **Iterators**: provides both `range` (as in [`iter.Seq`](https://pkg.go.dev/iter#Seq)) and object-based iterators.
- **...and more**: this package provides plenty in the way of features/ergonomics, but enumerating them is currently a TODO item 🙂
## Getting Started
Install:
```shell
go get github.com/sbueschel/go-linked
```
Usage:
```go
package main
import (
"fmt"
"github.com/sbueschel/go-linked"
)
func main() {
var list linked.List[int]
for n := range 10 {
list.PushFront(n)
}
list.ForEach(func(v int) { fmt.Printf("%d\n", v) })
}
```