Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nishanths/dedupimport
Deduplicate named and unnamed imports of the same import path in Go files
https://github.com/nishanths/dedupimport
ast go
Last synced: about 1 month ago
JSON representation
Deduplicate named and unnamed imports of the same import path in Go files
- Host: GitHub
- URL: https://github.com/nishanths/dedupimport
- Owner: nishanths
- License: bsd-3-clause
- Created: 2017-11-23T08:57:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-18T09:48:34.000Z (over 4 years ago)
- Last Synced: 2024-08-04T01:18:25.352Z (3 months ago)
- Topics: ast, go
- Language: Go
- Homepage: https://godoc.org/github.com/nishanths/dedupimport
- Size: 50.8 KB
- Stars: 18
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## dedupimport
[![Build Status](https://travis-ci.org/nishanths/dedupimport.svg?branch=master)](https://travis-ci.org/nishanths/dedupimport) [![Godoc](https://godoc.org/github.com/nishanths/dedupimport?status.svg)](http://godoc.org/github.com/nishanths/dedupimport)
Remove duplicate imports that have the same import path but different import
names.```
go get -u github.com/nishanths/dedupimport
```
See [godoc](https://godoc.org/github.com/nishanths/dedupimport) for flags and usage.## Example
Given the file
```
package pkgimport (
"code.org/frontend"
fe "code.org/frontend"
)var client frontend.Client
var server fe.Server
```running dedupimport on it with default options
```
dedupimport file.go
```will produce
```
package pkgimport (
"code.org/frontend"
)var client frontend.Client
var server frontend.Server
```