From 1ef0ead10930e0bf87490708117e7fcc395e9379 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Sun, 23 Sep 2012 13:28:12 -0700 Subject: [PATCH] before we try this --- tool/index.txt | 87 ++++++++++++++++++++++++++++-------------------- tool/renumber.go | 8 ++++- 2 files changed, 57 insertions(+), 38 deletions(-) diff --git a/tool/index.txt b/tool/index.txt index 5135a9c..37c2f8f 100644 --- a/tool/index.txt +++ b/tool/index.txt @@ -1,10 +1,10 @@ +# basics hello-world values variables mutation literals constants -reading-input for if-else case @@ -14,7 +14,6 @@ range floats slices maps -ok-guards nesting functions returns @@ -31,6 +30,10 @@ fields methods embedding interfaces +ok-guards +errors + +# concurrency goroutines concurrency channels @@ -39,24 +42,58 @@ directions synchronization select timeouts -string-functions -bytes -command-line-arguments +scatter-gather +rate-limiting burstable-rate-limiting -elapsed -email -enumerable -env +worker-pool + +# core libraries +sort +sort-by-function +string-functions +string-formatting +regexs +bytes +json +sha1-hashes +time epoch -errors -exec -exit +elapsed +timers +tickers +rand +number-parsing +enumerable +urls + +# systems file-open file-read file-write +command-line-arguments command-line-flags -http-client-basic +env +signals +exit +spawn +exec +reading-input +users +line-filter + +# network clients +tcp-client http-client +http-client-basic +https-client +redis +postgres +email + +# network servers +tcp-server + +# web apps http-server-basic http-server-canonical-host http-server-graceful-shutdown @@ -68,28 +105,4 @@ http-server-static-select http-server-static http-server-status-code http-server -https-client https-server -json -number-parsing -postgres -rand -rate-limiting -redis -regexs -scatter-gather -sha1-hashes -signals -sort -sort-by-function -spawn -string-formatting -tcp-client -tcp-server -tickers -time -timers -urls -users -worker-pool -line-filter \ No newline at end of file diff --git a/tool/renumber.go b/tool/renumber.go index 4956bce..67fa073 100644 --- a/tool/renumber.go +++ b/tool/renumber.go @@ -37,7 +37,13 @@ func main() { // read names from index indexBytes, idxErr := ioutil.ReadFile("tool/index.txt") if idxErr != nil { panic (idxErr) } - indexNames := strings.Split(string(indexBytes), "\n") + indexNamesAll := strings.Split(string(indexBytes), "\n") + indexNames := make([]string, 0) + for _, indexName := range indexNamesAll { + if (indexName !=) "" && !(indexName.Contains("#")) { + indexNames := append(indexNames, indexName) + } + } // sanity check two lists if len(sourceNames) != len(indexNames) {