1
0

Remove inteermidiate variable and instantiate struct in return statement.

This commit is contained in:
Alexander Andreev 2022-03-31 18:11:04 +04:00
parent 0d113d30a1
commit d3563abba1
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -55,15 +55,13 @@ func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) {
return nil, err return nil, err
} }
iceStat := &IcecastStatus{ return &IcecastStatus{
ServerStartISO8601: iceStatDTO.Icestats.ServerStartISO8601, ServerStartISO8601: iceStatDTO.Icestats.ServerStartISO8601,
ServerStartDate: iceStatDTO.Icestats.ServerStartDate, ServerStartDate: iceStatDTO.Icestats.ServerStartDate,
SongName: iceStatDTO.Song(), SongName: iceStatDTO.Song(),
ListenerPeak: iceStatDTO.Icestats.Source.ListenerPeak, ListenerPeak: iceStatDTO.Icestats.Source.ListenerPeak,
Listeners: iceStatDTO.Icestats.Source.Listeners, Listeners: iceStatDTO.Icestats.Source.Listeners,
} }, nil
return iceStat, nil
} }
func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) { func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) {