Skip to content

Commit 185bb17

Browse files
committed
Revert "start linting"
This reverts commit 83e6712.
1 parent e73bc24 commit 185bb17

24 files changed

Lines changed: 79 additions & 74 deletions

pkg/wcs201/capabilities.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package wcs201
22

33
// ParseXML func
4-
func (c *Capabilities) ParseXML(_ []byte) error {
4+
func (c *Capabilities) ParseXML(doc []byte) error {
55
return nil
66
}
77

88
// ParseYAML func
9-
func (c *Capabilities) ParseYAML(_ []byte) error {
9+
func (c *Capabilities) ParseYAML(doc []byte) error {
1010
return nil
1111
}
1212

pkg/wcs201/getcapabilities_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (gc *GetCapabilitiesRequest) Type() string {
2323
}
2424

2525
// Validate validates the GetCapabilities struct
26-
func (gc *GetCapabilitiesRequest) Validate(_ Capabilities) []wsc200.Exception {
26+
func (gc *GetCapabilitiesRequest) Validate(c Capabilities) []wsc200.Exception {
2727
return nil
2828
}
2929

pkg/wfs200/capabilities.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
)
77

88
// ParseXML func
9-
func (c *Capabilities) ParseXML(_ []byte) error {
9+
func (c *Capabilities) ParseXML(doc []byte) error {
1010
return nil
1111
}
1212

1313
// ParseYAML func
14-
func (c *Capabilities) ParseYAML(_ []byte) error {
14+
func (c *Capabilities) ParseYAML(doc []byte) error {
1515
return nil
1616
}
1717

pkg/wfs200/crs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111

1212
// CRS struct with namespace/authority/registry and code
1313
type CRS struct {
14-
Namespace string // TODO maybe AuthorityType is a better name...?
14+
Namespace string //TODO maybe AuthorityType is a better name...?
1515
Code int
1616
}
1717

pkg/wfs200/crs_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ othercrs:
5151
err := yaml.Unmarshal(test.yaml, &ftl)
5252
if err != nil {
5353
t.Errorf("test: %d, yaml.UnMarshal failed with '%s'\n", k, err)
54-
} else if ftl.DefaultCRS.Code != test.expectedcrs.Code || ftl.DefaultCRS.Namespace != test.expectedcrs.Namespace {
55-
t.Errorf("test: %d, expected: %v+,\n got: %v+", k, test.expectedcrs, ftl.DefaultCRS)
54+
} else {
55+
if ftl.DefaultCRS.Code != test.expectedcrs.Code || ftl.DefaultCRS.Namespace != test.expectedcrs.Namespace {
56+
t.Errorf("test: %d, expected: %v+,\n got: %v+", k, test.expectedcrs, ftl.DefaultCRS)
57+
}
5658
}
5759
}
5860
}

pkg/wfs200/describefeaturetype_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (d DescribeFeatureTypeRequest) Type() string {
2121
}
2222

2323
// Validate returns GetCapabilities
24-
func (d DescribeFeatureTypeRequest) Validate(_ wsc110.Capabilities) []wsc110.Exception {
24+
func (d DescribeFeatureTypeRequest) Validate(c wsc110.Capabilities) []wsc110.Exception {
2525
return nil
2626
}
2727

pkg/wfs200/exception_codes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func LockHasExpired() wsc110.Exception {
6363
// OperationParsingFailed exception
6464
func OperationParsingFailed(value, locator string) wsc110.Exception {
6565
return exception{
66-
ExceptionText: "Failed to parse the operation, found: " + value,
66+
ExceptionText: fmt.Sprintf("Failed to parse the operation, found: %s", value),
6767
LocatorCode: locator,
6868
ExceptionCode: "OperationParsingFailed"}
6969
}

pkg/wfs200/getcapabilities_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (g GetCapabilitiesRequest) Type() string {
1818
}
1919

2020
// Validate returns GetCapabilities
21-
func (g GetCapabilitiesRequest) Validate(_ wsc110.Capabilities) []wsc110.Exception {
21+
func (g GetCapabilitiesRequest) Validate(c wsc110.Capabilities) []wsc110.Exception {
2222
var exceptions []wsc110.Exception
2323
return exceptions
2424
}

pkg/wfs200/getcapabilities_request_pv.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/pdok/ogc-specifications/pkg/wsc110"
88
)
99

10-
// getCapabilitiesRequestParameterValue struct
10+
//getCapabilitiesRequestParameterValue struct
1111
type getCapabilitiesRequestParameterValue struct {
1212
service string `yaml:"service,omitempty"`
1313
baseParameterValueRequest
@@ -41,14 +41,14 @@ func (gpv *getCapabilitiesRequestParameterValue) parseQueryParameters(query url.
4141
// parseGetCapabilitiesRequest builds a getCapabilitiesRequestParameterValue object based on a GetCapabilities struct
4242
// This is a 'dummy' implementation, because for a GetCapabilities request it will always be
4343
// Mandatory: REQUEST=GetCapabilities
44-
//
45-
// SERVICE=WFS
46-
//
44+
// SERVICE=WFS
4745
// Optional: VERSION=2.0.0
48-
func (gpv *getCapabilitiesRequestParameterValue) parseGetCapabilitiesRequest(gc GetCapabilitiesRequest) {
46+
func (gpv *getCapabilitiesRequestParameterValue) parseGetCapabilitiesRequest(gc GetCapabilitiesRequest) []wsc110.Exception {
4947
gpv.request = getcapabilities
5048
gpv.version = gc.Version
5149
gpv.service = gc.Service
50+
51+
return nil
5252
}
5353

5454
// toQueryParameters builds a url.Values query from a getCapabilitiesRequestParameterValue struct

pkg/wfs200/getfeature_request.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (f GetFeatureRequest) Type() string {
5454
}
5555

5656
// Validate returns GetFeature
57-
func (f GetFeatureRequest) Validate(_ wsc110.Capabilities) []wsc110.Exception {
57+
func (f GetFeatureRequest) Validate(c wsc110.Capabilities) []wsc110.Exception {
5858

5959
//getfeaturecap := c.(capabilities.Capabilities)
6060
return nil
@@ -75,13 +75,7 @@ func (f *GetFeatureRequest) ParseXML(doc []byte) []wsc110.Exception {
7575
if err := xml.Unmarshal(doc, &xmlattributes); err != nil {
7676
return wsc110.NoApplicableCode("Could not process XML, is it XML?").ToExceptions()
7777
}
78-
79-
//When object can be Unmarshalled -> XMLAttributes, it can be Unmarshalled -> GetFeature
80-
//if err := xml.Unmarshal(doc, &f); err != nil {
81-
// return wsc110.NoApplicableCode("Could not process XML, is it XML?").ToExceptions()
82-
//}
83-
_ = xml.Unmarshal(doc, &f)
84-
78+
xml.Unmarshal(doc, &f) //When object can be Unmarshalled -> XMLAttributes, it can be Unmarshalled -> GetFeature
8579
var n []xml.Attr
8680
for _, a := range xmlattributes {
8781
switch strings.ToUpper(a.Name.Local) {
@@ -278,7 +272,7 @@ func (q *Query) parseKVPRequest(fpv getFeatureRequestParameterValue) []wsc110.Ex
278272
}
279273

280274
if len(selectionclause) > 1 {
281-
exceptions = append(exceptions, wsc110.NoApplicableCode(`Only one of the following selectionclauses can be used `+strings.Join(selectionclause, `,`)))
275+
exceptions = append(exceptions, wsc110.NoApplicableCode(fmt.Sprintf(`Only one of the following selectionclauses can be used %s`, strings.Join(selectionclause, `,`))))
282276
} else if len(selectionclause) == 1 {
283277
switch selectionclause[0] {
284278
case RESOURCEID:
@@ -430,12 +424,14 @@ func (r ResourceIDs) toString() string {
430424
return strings.Join(rids, ",")
431425
}
432426

433-
func (r *ResourceIDs) parseKVPRequest(resourceids string) {
427+
func (r *ResourceIDs) parseKVPRequest(resourceids string) []wsc110.Exception {
434428
var rids ResourceIDs
435429
for _, resourceid := range strings.Split(resourceids, `,`) {
436430
rids = append(rids, ResourceID{Rid: resourceid})
437431
}
438432
*r = rids
433+
434+
return nil
439435
}
440436

441437
// ResourceID struct for Filter

0 commit comments

Comments
 (0)