fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

build: handle nil Options in largeFilesFlag

The flag package may call the String method with a zero-valued receiver,
such as a nil pointer. For example this happens when passing in the flag
"-help", so this fixes a panic in that case. This was a panic introduced
in 5dd4713 build: factor out build flags.

Change-Id: I27e5b66637fe2f3ad8231baa3e5b355b579e052f

+7
+7
build/builder.go
··· 105 105 type largeFilesFlag struct{ *Options } 106 106 107 107 func (f largeFilesFlag) String() string { 108 + // From flag.Value documentation: 109 + // 110 + // The flag package may call the String method with a zero-valued receiver, 111 + // such as a nil pointer. 112 + if f.Options == nil { 113 + return "" 114 + } 108 115 s := append([]string{""}, f.LargeFiles...) 109 116 return strings.Join(s, "-large_file ") 110 117 }