-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Force import alias when package ends in /v[0-9]+$ (#409)
- Loading branch information
Showing
8 changed files
with
145 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type: fix | ||
fix: | ||
description: Force import alias when package ends in /v[0-9]+$ | ||
links: | ||
- https://github.com/palantir/conjure-go/pull/409 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
integration_test/testgenerated/imports/pkg4/v2/structs.conjure.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// This file was generated by Conjure and should not be manually edited. | ||
|
||
package v2 | ||
|
||
import ( | ||
"github.com/palantir/pkg/safejson" | ||
"github.com/palantir/pkg/safeyaml" | ||
) | ||
|
||
type ObjectInPackageEndingInVersion struct { | ||
Name string `json:"name"` | ||
} | ||
|
||
func (o ObjectInPackageEndingInVersion) MarshalYAML() (interface{}, error) { | ||
jsonBytes, err := safejson.Marshal(o) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return safeyaml.JSONtoYAMLMapSlice(jsonBytes) | ||
} | ||
|
||
func (o *ObjectInPackageEndingInVersion) UnmarshalYAML(unmarshal func(interface{}) error) error { | ||
jsonBytes, err := safeyaml.UnmarshalerToJSONBytes(unmarshal) | ||
if err != nil { | ||
return err | ||
} | ||
return safejson.Unmarshal(jsonBytes, *&o) | ||
} |
28 changes: 28 additions & 0 deletions
28
integration_test/testgenerated/imports/pkg5/v2/structs.conjure.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// This file was generated by Conjure and should not be manually edited. | ||
|
||
package v2 | ||
|
||
import ( | ||
"github.com/palantir/pkg/safejson" | ||
"github.com/palantir/pkg/safeyaml" | ||
) | ||
|
||
type DifferentPackageEndingInVersion struct { | ||
Name string `json:"name"` | ||
} | ||
|
||
func (o DifferentPackageEndingInVersion) MarshalYAML() (interface{}, error) { | ||
jsonBytes, err := safejson.Marshal(o) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return safeyaml.JSONtoYAMLMapSlice(jsonBytes) | ||
} | ||
|
||
func (o *DifferentPackageEndingInVersion) UnmarshalYAML(unmarshal func(interface{}) error) error { | ||
jsonBytes, err := safeyaml.UnmarshalerToJSONBytes(unmarshal) | ||
if err != nil { | ||
return err | ||
} | ||
return safejson.Unmarshal(jsonBytes, *&o) | ||
} |