Skip to content

Commit 5526aeb

Browse files
committed
fix some doc issues and misspellings
1 parent de17d3b commit 5526aeb

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Go Lazada [![GoDoc](https://godoc.org/github.com/teddy-schmitz/go-lazada/lazada?status.png)](https://godoc.org/github.com/teddy-schmitz/go-lazada/lazada)
1+
# Go Lazada [![GoDoc](https://godoc.org/github.com/Teddy-Schmitz/go-lazada/lazada?status.png)](https://godoc.org/github.com/Teddy-Schmitz/go-lazada/lazada)
22
Unofficial Go library for the [Lazada Open Platform]("https://open.lazada.com/")
33

44
## Install
55

66
```
7-
go get github.com/teddy-schmitz/go-lazada
7+
go get github.com/Teddy-Schmitz/go-lazada
88
```
99

1010
## Usage
1111

1212
```go
13-
import "github.com/teddy-schmitz/go-lazada/lazada"
13+
import "github.com/Teddy-Schmitz/go-lazada/lazada"
1414
```
1515

1616
Construct a client with a specific region

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/teddy-schmitz/go-lazada
1+
module github.com/Teddy-Schmitz/go-lazada
22

33
require (
44
github.com/davecgh/go-spew v1.1.1 // indirect

lazada/constants.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ var apiNames = map[string]string{
1313
"GetProducts": "/products/get",
1414
}
1515

16-
// Lazada Regions
1716
type Region string
1817

1918
const (
2019
SriLanka Region = "lk"
21-
Phillipines = "ph"
20+
Philippines = "ph"
2221
Bangladesh = "bd"
2322
Thailand = "th"
2423
Vietnam = "vn"
@@ -33,7 +32,7 @@ const (
3332
// endpoints maps a regions shortcode to its URL
3433
var endpoints = map[Region]string{
3534
SriLanka: "https://api.daraz.lk/",
36-
Phillipines: "https://api.lazada.com.ph/",
35+
Philippines: "https://api.lazada.com.ph/",
3736
Bangladesh: "https://api.daraz.com.bd/",
3837
Thailand: "https://api.lazada.co.th/",
3938
Vietnam: "https://api.lazada.vn/",

lazada/createProduct.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ type ProductRequest struct {
99

1010
type Attributes struct {
1111
XMLName xml.Name `xml:"Attributes,omitempty"`
12-
Attrs StringMap
12+
Attrs StringMap
1313
}
1414

1515
type Images struct {
1616
XMLName xml.Name `xml:"Images,omitempty"`
17-
Image []string `xml:"Image,omitempty"`
17+
Image []string `xml:"Image,omitempty"`
1818
}
1919

2020
type Product struct {
21-
XMLName xml.Name `xml:"Product,omitempty"`
22-
Attributes *Attributes `xml:"Attributes,omitempty"`
23-
PrimaryCategory string `xml:"PrimaryCategory,omitempty"`
24-
Skus []*Sku `xml:"Skus>Sku,omitempty"`
21+
XMLName xml.Name `xml:"Product,omitempty"`
22+
Attributes *Attributes `xml:"Attributes,omitempty"`
23+
PrimaryCategory string `xml:"PrimaryCategory,omitempty"`
24+
Skus []*Sku `xml:"Skus>Sku,omitempty"`
2525
}
2626

2727
type Sku struct {
2828
XMLName xml.Name `xml:"Sku,omitempty"`
29-
Images *Images `xml:"Images,omitempty"`
30-
SellerSku string `xml:"SellerSku"`
29+
Images *Images `xml:"Images,omitempty"`
30+
SellerSku string `xml:"SellerSku"`
3131
SkuAttrs StringMap
3232
}

lazada/stringmap.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ func (s StringMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
1010
tokens := []xml.Token{}
1111

1212
for key, value := range s {
13-
t := xml.StartElement{Name: xml.Name{"", key}}
14-
tokens = append(tokens, t, xml.CharData(value), xml.EndElement{t.Name})
13+
t := xml.StartElement{Name: xml.Name{Space: "", Local: key}}
14+
tokens = append(tokens, t, xml.CharData(value), xml.EndElement{Name: t.Name})
1515
}
1616

1717
for _, t := range tokens {

tests/products_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/stretchr/testify/assert"
1111
"github.com/stretchr/testify/require"
12-
"gitlab.com/teddy-schmitz/go-lazada/lazada"
12+
"gitlab.com/Teddy-Schmitz/go-lazada/lazada"
1313
)
1414

1515
var AppKey = os.Getenv("APP_KEY")

0 commit comments

Comments
 (0)