fmt.Sprint/Sprintf
SCC-S1039 826 // quotes need to be include if not eq NONE
827 vp.Captions = "CC1"
828 m2 := NewMasterPlaylist()
829 m2.Append(fmt.Sprintf("eng_rendition_rendition.m3u8"), p, *vp) 830 expected = `CLOSED-CAPTIONS="CC1"`
831 if !strings.Contains(m2.String(), expected) {
832 t.Fatalf("Master playlist did not contain: %s\nMaster Playlist:\n%v", expected, m2.String())
817 if err != nil {
818 t.Fatalf("Create media playlist failed: %s", err)
819 }
820 m.Append(fmt.Sprintf("eng_rendition_rendition.m3u8"), p, *vp) 821
822 expected := "CLOSED-CAPTIONS=NONE"
823 if !strings.Contains(m.String(), expected) {
fmt.Sprint
is not needed when there is only one literal string argument to the
function. Similarly, fmt.Sprintf
is not required when the string to be
formatted does not contain any format specifiers.
x := fmt.Sprint("hello")
y := fmt.Sprintf("Say what")
x := "hello"
y := "Say what"