ID is better than Id according to Golang

This commit is contained in:
Yohann D'ANELLO 2020-10-02 10:33:16 +02:00
parent 12bd0b71e3
commit 8eab4dfe22
2 changed files with 6 additions and 6 deletions

View File

@ -71,20 +71,20 @@ func Serve(cfg *Options, authBackend auth.Backend, forwardingChannel chan Packet
break // FIXME: should not break here
}
streamId, err := s.GetSockOptString(C.SRTO_STREAMID)
streamID, err := s.GetSockOptString(C.SRTO_STREAMID)
if err != nil {
log.Println("Error while fetching stream key:", err)
s.Close()
continue
}
if !strings.Contains(streamId, "|") {
log.Printf("Warning: stream id must be at the format streamId|password. Input: %s", streamId)
if !strings.Contains(streamID, "|") {
log.Printf("Warning: stream id must be at the format streamID|password. Input: %s", streamID)
s.Close()
continue
}
splittedStreamId := strings.SplitN(streamId, "|", 2)
streamName, password := splittedStreamId[0], splittedStreamId[1]
splittedStreamID := strings.SplitN(streamID, "|", 2)
streamName, password := splittedStreamID[0], splittedStreamID[1]
loggedIn, err := authBackend.Login(streamName, password)
if !loggedIn {
log.Printf("Invalid credentials for stream %s.", streamName)

View File

@ -40,7 +40,7 @@ func TestServeSRT(t *testing.T) {
ffmpeg := exec.Command("ffmpeg",
"-i", "http://ftp.crans.org/events/Blender%20OpenMovies/big_buck_bunny_480p_stereo.ogg",
"-f", "flv", "srt://127.0.0.1:9711??streamid=demo|")
"-f", "flv", "srt://127.0.0.1:9711?streamid=demo|")
output, err := ffmpeg.StdoutPipe()
errOutput, err := ffmpeg.StderrPipe()