Created
March 2, 2015 11:25
-
-
Save jaz303/516ba350fe9c00293036 to your computer and use it in GitHub Desktop.
Is there a better way to write this?
This file contains hidden or 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
| var publisherUsername string | |
| var username string | |
| var projectName string | |
| var archiveType string | |
| var archivePath string | |
| var timeReceived string | |
| if publisherUsername, err = readLine(); err != nil { return nil, err } | |
| if username, err = readLine(); err != nil { return nil, err } | |
| if projectName, err = readLine(); err != nil { return nil, err } | |
| if archiveType, err = readLine(); err != nil { return nil, err } | |
| if archivePath, err = readLine(); err != nil { return nil, err } | |
| if timeReceived, err = readLine(); err != nil { return nil, err } | |
| parsedTime, err := time.Parse("", timeReceived) | |
| if err != nil { | |
| return nil, err | |
| } | |
| return &Job{ | |
| PublisherUsername: publisherUsername, | |
| Username: username, | |
| ProjectName: projectName, | |
| ArchiveType: archiveType, | |
| ArchivePath: archivePath, | |
| TimeReceived: parsedTime, | |
| }, nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment