From d3563abba19acbc4e0eaae6f5b502a2c8de3b46a Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 31 Mar 2022 18:11:04 +0400 Subject: [PATCH] Remove inteermidiate variable and instantiate struct in return statement. --- internal/radio/icecast.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 99ec5c5..905e5b9 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -55,15 +55,13 @@ func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) { return nil, err } - iceStat := &IcecastStatus{ + return &IcecastStatus{ ServerStartISO8601: iceStatDTO.Icestats.ServerStartISO8601, ServerStartDate: iceStatDTO.Icestats.ServerStartDate, SongName: iceStatDTO.Song(), ListenerPeak: iceStatDTO.Icestats.Source.ListenerPeak, Listeners: iceStatDTO.Icestats.Source.Listeners, - } - - return iceStat, nil + }, nil } func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) {