Skip to content

Commit

Permalink
add names to specs
Browse files Browse the repository at this point in the history
  • Loading branch information
alovak committed Jul 15, 2021
1 parent 75d0487 commit 9389141
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/iso8583/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
"github.com/moov-io/iso8583/field"
)

var defaultSpecName = "ISO 8583"

func Message(w io.Writer, message *iso8583.Message) error {
specName := "ISO 8583"
specName := defaultSpecName
if spec := message.GetSpec(); spec != nil && spec.Name != "" {
specName = spec.Name
}
Expand Down
2 changes: 1 addition & 1 deletion spec87.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// keep it here for a little while for compatibility
// all new specs and updates to Spec87 should go to ./specs
var Spec87 *MessageSpec = &MessageSpec{
Name: "ISO 8583:1987 ASCII",
Name: "ISO 8583 v1987 ASCII",
Fields: map[int]field.Field{
0: field.NewString(&field.Spec{
Length: 4,
Expand Down
1 change: 1 addition & 0 deletions specs/spec87ascii.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

// we keep it for compatibility reasons
var Spec87ASCII *iso8583.MessageSpec = &iso8583.MessageSpec{
Name: "ISO 8583 v1987 ASCII",
Fields: map[int]field.Field{
0: field.NewString(&field.Spec{
Length: 4,
Expand Down
1 change: 1 addition & 0 deletions specs/spec87hex.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

var Spec87Hex *iso8583.MessageSpec = &iso8583.MessageSpec{
Name: "ISO 8583 v1987 Hex",
Fields: map[int]field.Field{
0: field.NewString(&field.Spec{
Length: 4,
Expand Down

0 comments on commit 9389141

Please sign in to comment.