Skip to content

Commit eb817e9

Browse files
authored
Update README.md
1 parent 706777e commit eb817e9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ The following example demonstrates how to:
6464
- Unpack and parse a received message
6565

6666
```go
67+
package main
68+
69+
import (
70+
"os"
71+
72+
"github.com/moov-io/iso8583"
73+
"github.com/moov-io/iso8583/examples"
74+
)
75+
6776
// Define types for the message fields
6877
type Authorization struct {
6978
MTI string `iso8583:"0"` // Message Type Indicator
@@ -81,7 +90,7 @@ type AcceptorInformation struct {
8190
Country string `index:"3"`
8291
}
8392

84-
func Example() {
93+
func main() {
8594
// Pack the message
8695
msg := iso8583.NewMessage(examples.Spec)
8796

@@ -114,7 +123,7 @@ func Example() {
114123
// ...
115124

116125
// Unpack the message
117-
msg = iso8583.NewMessage(Spec)
126+
msg = iso8583.NewMessage(examples.Spec)
118127
err = msg.Unpack(packed)
119128
if err != nil {
120129
panic(err)

0 commit comments

Comments
 (0)