From dab2ab18675d9e545005001f360b99f07544660a Mon Sep 17 00:00:00 2001 From: Matt Jibson Date: Wed, 17 Oct 2018 14:04:16 -0400 Subject: [PATCH 1/2] Specify that 'g' avoids the 'f' ambiguity Fixes #74 --- format.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format.go b/format.go index 9d59883..3aea01f 100644 --- a/format.go +++ b/format.go @@ -23,7 +23,8 @@ import ( // If format is a different character, Text returns a "%" followed by the // unrecognized.Format character. The 'f' format has the possibility of // displaying precision that is not present in the Decimal when it appends -// zeros. All other formats always show the exact precision of the Decimal. +// zeros (the 'g' format avoids the use of 'f' in this case). All other +// formats always show the exact precision of the Decimal. func (d *Decimal) Text(format byte) string { cap := 10 // TODO(gri) determine a good/better value here return string(d.Append(make([]byte, 0, cap), format)) From e517940feb78735e3d6628a11f915bb4bf07abb4 Mon Sep 17 00:00:00 2001 From: Matt Jibson Date: Wed, 17 Oct 2018 14:04:25 -0400 Subject: [PATCH 2/2] Add go module definitions --- go.mod | 3 +++ go.sum | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..5b03064 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/cockroachdb/apd + +require github.com/pkg/errors v0.8.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..3dfe462 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=