Compare commits
3 Commits
c2e4dc5abf
...
c518272fb9
Author | SHA1 | Date |
---|---|---|
sudo pacman -Syu | c518272fb9 | |
sudo pacman -Syu | 8d5c63b8db | |
sudo pacman -Syu | 3b35876b7f |
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -1,5 +1,21 @@
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## v0.0.5 (2023-01-17)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- feat: cache module name even when read dir to improve perf (2023-01-17)
|
||||||
|
|
||||||
|
- feat: use sync.Pool to reuse bytes.Buffer (2023-01-17)
|
||||||
|
|
||||||
|
- feat: add profiler (2023-01-17)
|
||||||
|
|
||||||
|
- feat: add go profiler (2023-01-17)
|
||||||
|
|
||||||
|
### Others
|
||||||
|
|
||||||
|
- chore(changelog): generate v0.0.4 (2023-01-17)
|
||||||
|
|
||||||
## v0.0.4 (2023-01-17)
|
## v0.0.4 (2023-01-17)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -1,4 +1,4 @@
|
||||||
.PHONY: all test test-color coverage coverage-cli coverate-html lint format build
|
.PHONY: all test test-color coverage coverage-cli coverate-html lint format build clean docs
|
||||||
|
|
||||||
all: test-color lint format
|
all: test-color lint format
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
@ -33,3 +33,7 @@ build: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf gofimports
|
rm -rf gofimports
|
||||||
|
|
||||||
|
docs:
|
||||||
|
go install go101.org/golds@latest
|
||||||
|
golds ./...
|
||||||
|
|
|
@ -45,11 +45,9 @@ var bufPool = sync.Pool{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// stdPackages -> save std packages for later search
|
// stdPackages -> save std packages for later search.
|
||||||
//
|
// moduleNames -> map path to its go.mod module name.
|
||||||
// moduleNames -> map path to its go.mod module name
|
// formattedPaths -> make sure we not format path more than 1 time.
|
||||||
//
|
|
||||||
// formattedPaths -> make sure we not format path more than 1 time
|
|
||||||
type Formatter struct {
|
type Formatter struct {
|
||||||
stdPackages map[string]struct{}
|
stdPackages map[string]struct{}
|
||||||
moduleNames map[string]string
|
moduleNames map[string]string
|
||||||
|
@ -234,7 +232,7 @@ func (ft *Formatter) formatFile(path string) error {
|
||||||
// First parse ast.
|
// First parse ast.
|
||||||
// Then group imports.
|
// Then group imports.
|
||||||
// Then format imports.
|
// Then format imports.
|
||||||
// Then print.
|
// Then print to bytes.
|
||||||
func (ft *Formatter) formatImports(
|
func (ft *Formatter) formatImports(
|
||||||
path string,
|
path string,
|
||||||
pathBytes []byte,
|
pathBytes []byte,
|
||||||
|
|
Loading…
Reference in New Issue