switch to if
This commit is contained in:
parent
37028a7f0f
commit
b0b6dbeb1b
@ -230,10 +230,9 @@ func parseExamples() []*Example {
|
|||||||
example.Segs = make([][]*Seg, 0)
|
example.Segs = make([][]*Seg, 0)
|
||||||
sourcePaths := mustGlob("examples/" + exampleId + "/*")
|
sourcePaths := mustGlob("examples/" + exampleId + "/*")
|
||||||
for _, sourcePath := range sourcePaths {
|
for _, sourcePath := range sourcePaths {
|
||||||
switch strings.HasSuffix(sourcePath, ".hash") {
|
if strings.HasSuffix(sourcePath, ".hash") {
|
||||||
case true:
|
|
||||||
example.GoCodeHash, example.UrlHash = parseHashFile(sourcePath)
|
example.GoCodeHash, example.UrlHash = parseHashFile(sourcePath)
|
||||||
default:
|
} else {
|
||||||
sourceSegs, filecontents := parseAndRenderSegs(sourcePath)
|
sourceSegs, filecontents := parseAndRenderSegs(sourcePath)
|
||||||
if filecontents != "" {
|
if filecontents != "" {
|
||||||
example.GoCode = filecontents
|
example.GoCode = filecontents
|
||||||
|
Loading…
x
Reference in New Issue
Block a user