https://github.com/sourcegraph/tf-dag
Fork of directed acyclic graph (DAG) implementation from hashicorp/terraform
https://github.com/sourcegraph/tf-dag
Last synced: 14 days ago
JSON representation
Fork of directed acyclic graph (DAG) implementation from hashicorp/terraform
- Host: GitHub
- URL: https://github.com/sourcegraph/tf-dag
- Owner: sourcegraph
- License: mpl-2.0
- Created: 2023-01-04T01:40:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-11-13T13:29:23.000Z (4 months ago)
- Last Synced: 2026-01-15T17:03:49.809Z (about 2 months ago)
- Language: Go
- Homepage: https://pkg.go.dev/github.com/sourcegraph/tf-dag
- Size: 65.4 KB
- Stars: 18
- Watchers: 22
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# tf-dag
Fork of [github.com/terraform/hashicorp/internal/dag](https://github.com/hashicorp/terraform/tree/main/internal/dag). Directed acyclic graph (DAG) implementation in Go.
## Why the fork?
The `dag` package from [terraform/hashicorp] is one of the most well maintained and tested DAG implementations in Go, and [many projects depend on it](https://sourcegraph.com/search?q=context:global+lang:Go+%22github.com/hashicorp/terraform/dag%22&patternType=standard&sm=1&groupBy=repo). However, it was [made internal](https://github.com/hashicorp/terraform/commit/70eebe3521d2f1ffcb5c12b75e90f1b82db94551). Additionally, upstream package contains a lot of extra dependencies where most projects do not need.
By forking it, we can import it as a standlone package and introduce custom changes to make it more generic.
### Changes
Below is a list of changes we made to the upstream package:
- [x] replace the use of [`tfdiags`](https://github.com/hashicorp/terraform/tree/main/internal/tfdiags) with `error`
- [ ] remove logging
## Usage
```sh
go get github.com/sourcegraph/tf-dag
```
[terraform/hashicorp]: https://github.com/hashicorp/terraform