Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate code #24

Open
Brookke opened this issue Nov 13, 2016 · 4 comments
Open

Duplicate code #24

Brookke opened this issue Nov 13, 2016 · 4 comments

Comments

@Brookke
Copy link
Member

Brookke commented Nov 13, 2016

Looking through the code on season.go and show.go for parsing the time of the seasons there is a lot of duplicate or similar code. I think could probably be put into one function, but I am unsure where this would go or if its definitely appropriate.

see:
https://github.com/UniversityRadioYork/myradio-go/blob/master/show.go#L116
https://github.com/UniversityRadioYork/myradio-go/blob/master/season.go#L72
https://github.com/UniversityRadioYork/myradio-go/blob/master/season.go#L20

and maybe this too
https://github.com/UniversityRadioYork/myradio-go/blob/master/season.go#L41

@MattWindsor91
Copy link
Member

Can't look at this until Wednesday at the earliest, sorry

@Brookke
Copy link
Member Author

Brookke commented Nov 13, 2016

@CaptainHayashi no worries

@LordAro
Copy link
Member

LordAro commented Nov 13, 2016

Most of this stems from myradio not having a standardised time return value (see UniversityRadioYork/MyRadio#565).

Failing getting MyRadio standardised in the near future, I'd like to see a (or possibly multiple) custom "time" type in myradio-go that implements the relevant (Un)marshalJSON functions, so that the *Raw members of the structs are no longer necessary.

For now though, a few lines of converting one type to another isn't a huge issue - it's just what's necessary at present

@MattWindsor91
Copy link
Member

#34 tried to fix this up a little. There are still issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants