dst VS goimports

Compare dst vs goimports and see what are their differences.

dst

Decorated Syntax Tree - manipulate Go source with perfect fidelity. (by dave)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
dst goimports
2 46
1,218 7,229
- 0.6%
0.0 9.8
7 months ago 4 days ago
Go Go
GNU General Public License v3.0 or later BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

dst

Posts with mentions or reviews of dst. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-22.
  • betteralign - structs field alignment static analyzer for Go
    8 projects | /r/golang | 22 Mar 2023
    Retaining comments has been done with using DST (Decorated Syntax Tree) with decorating regular AST. Sadly when using DST we cannot use "fix" mode with SuggestedFixes, but we have to print whole DST to retain decorations. Leading/ending comment positioning isn't well retained in some cases and it's still a work in progress.
  • Rewriting Go source code with AST tooling
    1 project | news.ycombinator.com | 3 Oct 2021
    Go AST was never really designed for re-writing of the source. Comments are stored by their byte offset instead of attached to nodes, so re-arranging nodes breaks the output...

    Check out my dst (decorated syntax tree) library: it allows you to manipulate Go source without breaking the comments and line-feeds:

    https://github.com/dave/dst

goimports

Posts with mentions or reviews of goimports. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-12.

What are some alternatives?

When comparing dst and goimports you can also consider the following projects:

go - The Go programming language

gofumpt - A stricter gofmt

nvim-lspconfig - Quickstart configs for Nvim LSP

goreturns - A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types

GoLint - [mirror] This is a linter for Go source code. (deprecated)

staticcheck

golines - A golang formatter that fixes long lines

go-checkstyle - checkstyle for go

Go Metalinter

GoCover.io - GoCover.io offers the code coverage of any golang package as a service.

interfacer

apicompat - apicompat checks recent changes to a Go project for backwards incompatible changes