-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve format rounding algo, support half-up rounding (#78)
* improve rounding algo, support half-up rounding * support context-controlled parsing * add make lint * fix formatting regression
- Loading branch information
Showing
11 changed files
with
543 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.PHONY: all | ||
all: test test-debug build-linux lint | ||
|
||
.PHONY: test | ||
test: | ||
go test | ||
|
||
.PHONY: test-debug | ||
test-debug: | ||
go test -tags=decimal_debug | ||
|
||
.PHONY: build-linux | ||
build-linux: | ||
GOOS=linux $(MAKE) build build-32bit | ||
|
||
.PHONY: build | ||
build-64bit: | ||
go test -c -o decimal.$@.test . && rm -f decimal.$@.test | ||
go test -c -o decimal.$@.debug.test -tags=decimal_debug . && rm -f decimal.$@.debug.test | ||
|
||
.PHONY: build-32bit | ||
build-32bit: | ||
GOARCH=arm go test -c -o decimal.$@.test . && rm -f decimal.$@.test | ||
GOARCH=arm go test -c -o decimal.$@.debug.test -tags=decimal_debug . && rm -f decimal.$@.debug.test | ||
|
||
# Dependency on build-linux primes Go caches. | ||
.PHONY: lint | ||
lint: build-linux | ||
docker run --rm \ | ||
-w /app \ | ||
-v $(PWD):/app \ | ||
-v `go env GOCACHE`:/root/.cache/go-build \ | ||
-v `go env GOMODCACHE`:/go/pkg/mod \ | ||
golangci/golangci-lint:v1.60.1-alpine \ | ||
golangci-lint run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.