webrtc.NewIceServer already does this split / validation

It also expects to be called with a non-empty string, which isn't
the case with this Split which always envokes the loop at least
once.  If -ice was omitted, an error was logged.
This commit is contained in:
Arlo Breault 2017-10-18 11:13:25 -04:00
parent 58556dc07b
commit bbb5a6aca2

View file

@ -145,11 +145,8 @@ func main() {
log.Println("\n\n\n --- Starting Snowflake Client ---") log.Println("\n\n\n --- Starting Snowflake Client ---")
var iceServers IceServerList var iceServers IceServerList
log.Println("IceServerList:") if len(strings.TrimSpace(*iceServersCommas)) > 0 {
for _, server := range strings.Split(*iceServersCommas, ",") { option := webrtc.OptionIceServer(*iceServersCommas)
// TODO: STUN / TURN url format validation?
log.Println(server)
option := webrtc.OptionIceServer(server)
iceServers = append(iceServers, option) iceServers = append(iceServers, option)
} }