Skip to content

Commit

Permalink
add comments for Format
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Oct 15, 2023
1 parent 25eef92 commit 8526be2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions format.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

var _ fmt.Formatter = Int128{}

// Format implements [fmt.Formatter].
func (a Int128) Format(s fmt.State, ch rune) {
var out []byte
var prefix []byte
Expand Down Expand Up @@ -112,6 +113,7 @@ func (a Int128) Format(s fmt.State, ch rune) {

var _ fmt.Formatter = Uint128{}

// Format implements [fmt.Formatter].
func (a Uint128) Format(s fmt.State, ch rune) {
var out []byte
var prefix []byte
Expand Down
1 change: 1 addition & 0 deletions format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestInt128Format(t *testing.T) {
{"%8d", Int128{0, 0}, " 0"},
{"%08d", Int128{0, 0}, "00000000"},
{"%-8d", Int128{0, 0}, "0 "},
{"%-8d", Int128{0, 1}.Neg(), "-1 "},
{"%+08d", Int128{0, 0}, "+0000000"},
{"%+8d", Int128{0, 0}, " +0"},
{"% 08d", Int128{0, 0}, " 0000000"},
Expand Down

0 comments on commit 8526be2

Please sign in to comment.