Add String() Method to ObjectType #15

Merged
Merovius merged 1 commits from objtype into polymorphism-take-2 2013-04-25 19:40:39 -05:00
Merovius commented 2013-04-25 19:10:25 -05:00 (Migrated from github.com)

This enables the builtin formatting functions of go to output the type of an object in a human-readable format, for example:

    blob, ok := obj.(*git.Blob)
    if !ok {
        fmt.Errorf("Not a Blob, but a %v", obj.Type())
    }
This enables the builtin formatting functions of go to output the type of an object in a human-readable format, for example: ``` blob, ok := obj.(*git.Blob) if !ok { fmt.Errorf("Not a Blob, but a %v", obj.Type()) } ```
vmg commented 2013-04-25 19:40:37 -05:00 (Migrated from github.com)

Neato!

Neato!
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#15
No description provided.