-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test: Asymmetrical unmarshal API * Test: Symmetric marshal API * Revert "Test: Symmetric marshal API" This reverts commit f51c64a. * Cleanup test example and add SourceUnitUnmarshaller interface * Add CommonSourceUnit implementation * Update comments * Remove UnmarshalJSON
- Loading branch information
1 parent
401688d
commit e12f0f8
Showing
2 changed files
with
25 additions
and
0 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,12 @@ | ||
package sources | ||
|
||
// CommonSourceUnit is a common implementation of SourceUnit that Sources can | ||
// use instead of implementing their own types. | ||
type CommonSourceUnit struct { | ||
ID string `json:"source_unit_id"` | ||
} | ||
|
||
// Implement the SourceUnit interface. | ||
func (c CommonSourceUnit) SourceUnitID() string { | ||
return c.ID | ||
} |
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