diff --git a/01-hello-world.go b/001-hello-world.go similarity index 100% rename from 01-hello-world.go rename to 001-hello-world.go diff --git a/28-values.go b/002-values.go similarity index 100% rename from 28-values.go rename to 002-values.go diff --git a/05-variables.go b/003-variables.go similarity index 100% rename from 05-variables.go rename to 003-variables.go diff --git a/06-mutation.go b/004-mutation.go similarity index 100% rename from 06-mutation.go rename to 004-mutation.go diff --git a/07-literal.go b/005-literal.go similarity index 100% rename from 07-literal.go rename to 005-literal.go diff --git a/08-constant.go b/006-constant.go similarity index 100% rename from 08-constant.go rename to 006-constant.go diff --git a/09-reading-input.go b/007-reading-input.go similarity index 100% rename from 09-reading-input.go rename to 007-reading-input.go diff --git a/10-for.go b/008-for.go similarity index 100% rename from 10-for.go rename to 008-for.go diff --git a/11-if-else.go b/009-if-else.go similarity index 100% rename from 11-if-else.go rename to 009-if-else.go diff --git a/11x-case.go b/010-case.go similarity index 100% rename from 11x-case.go rename to 010-case.go diff --git a/12-arrays.go b/011-arrays.go similarity index 100% rename from 12-arrays.go rename to 011-arrays.go diff --git a/13-sum.go b/012-sum.go similarity index 100% rename from 13-sum.go rename to 012-sum.go diff --git a/14-range.go b/013-range.go similarity index 100% rename from 14-range.go rename to 013-range.go diff --git a/15-floats.go b/014-floats.go similarity index 100% rename from 15-floats.go rename to 014-floats.go diff --git a/16-slices.go b/015-slices.go similarity index 100% rename from 16-slices.go rename to 015-slices.go diff --git a/17-maps.go b/016-maps.go similarity index 100% rename from 17-maps.go rename to 016-maps.go diff --git a/18-ok-guards.go b/017-ok-guards.go similarity index 100% rename from 18-ok-guards.go rename to 017-ok-guards.go diff --git a/19-nesting.go b/018-nesting.go similarity index 100% rename from 19-nesting.go rename to 018-nesting.go diff --git a/20-functions.go b/019-functions.go similarity index 100% rename from 20-functions.go rename to 019-functions.go diff --git a/21-returns.go b/020-returns.go similarity index 100% rename from 21-returns.go rename to 020-returns.go diff --git a/22-varargs.go b/021-varargs.go similarity index 100% rename from 22-varargs.go rename to 021-varargs.go diff --git a/23-closures.go b/022-closures.go similarity index 100% rename from 23-closures.go rename to 022-closures.go diff --git a/24-recursion.go b/023-recursion.go similarity index 100% rename from 24-recursion.go rename to 023-recursion.go diff --git a/25-defer.go b/024-defer.go similarity index 100% rename from 25-defer.go rename to 024-defer.go diff --git a/26-panic.go b/025-panic.go similarity index 100% rename from 26-panic.go rename to 025-panic.go diff --git a/27-recover.go b/026-recover.go similarity index 100% rename from 27-recover.go rename to 026-recover.go diff --git a/29-pointers.go b/028-pointers.go similarity index 100% rename from 29-pointers.go rename to 028-pointers.go diff --git a/30-new.go b/029-new.go similarity index 100% rename from 30-new.go rename to 029-new.go diff --git a/31-structs.go b/030-structs.go similarity index 100% rename from 31-structs.go rename to 030-structs.go diff --git a/32-fields.go b/031-fields.go similarity index 100% rename from 32-fields.go rename to 031-fields.go diff --git a/33-methods.go b/032-methods.go similarity index 100% rename from 33-methods.go rename to 032-methods.go diff --git a/34-embedding.go b/033-embedding.go similarity index 100% rename from 34-embedding.go rename to 033-embedding.go diff --git a/35-interfaces.go b/034-interfaces.go similarity index 100% rename from 35-interfaces.go rename to 034-interfaces.go diff --git a/36-goroutines.go b/035-goroutines.go similarity index 100% rename from 36-goroutines.go rename to 035-goroutines.go diff --git a/37-concurrency.go b/036-concurrency.go similarity index 100% rename from 37-concurrency.go rename to 036-concurrency.go diff --git a/38-channels.go b/037-channels.go similarity index 100% rename from 38-channels.go rename to 037-channels.go diff --git a/39-buffering.go b/038-buffering.go similarity index 100% rename from 39-buffering.go rename to 038-buffering.go diff --git a/40-directions.go b/039-directions.go similarity index 100% rename from 40-directions.go rename to 039-directions.go diff --git a/41-synchronization.go b/040-synchronization.go similarity index 100% rename from 41-synchronization.go rename to 040-synchronization.go diff --git a/42-select.go b/041-select.go similarity index 100% rename from 42-select.go rename to 041-select.go diff --git a/43-timeout.go b/042-timeout.go similarity index 100% rename from 43-timeout.go rename to 042-timeout.go diff --git a/44-string-fns.go b/043-string-fns.go similarity index 100% rename from 44-string-fns.go rename to 043-string-fns.go diff --git a/45-bytes.go b/044-bytes.go similarity index 100% rename from 45-bytes.go rename to 044-bytes.go diff --git a/xx-args.go b/045-args.go similarity index 100% rename from xx-args.go rename to 045-args.go diff --git a/xx-burstable-rate-limiting.go b/046-burstable-rate-limiting.go similarity index 100% rename from xx-burstable-rate-limiting.go rename to 046-burstable-rate-limiting.go diff --git a/xx-dns.go b/047-dns.go similarity index 100% rename from xx-dns.go rename to 047-dns.go diff --git a/xx-elapsed.go b/048-elapsed.go similarity index 100% rename from xx-elapsed.go rename to 048-elapsed.go diff --git a/xx-email.go b/049-email.go similarity index 100% rename from xx-email.go rename to 049-email.go diff --git a/xx-enumerable.go b/050-enumerable.go similarity index 100% rename from xx-enumerable.go rename to 050-enumerable.go diff --git a/xx-env.go b/051-env.go similarity index 100% rename from xx-env.go rename to 051-env.go diff --git a/xx-epoch.go b/052-epoch.go similarity index 100% rename from xx-epoch.go rename to 052-epoch.go diff --git a/xx-errors.go b/053-errors.go similarity index 100% rename from xx-errors.go rename to 053-errors.go diff --git a/xx-exec.go b/054-exec.go similarity index 100% rename from xx-exec.go rename to 054-exec.go diff --git a/xx-exits.go b/055-exits.go similarity index 100% rename from xx-exits.go rename to 055-exits.go diff --git a/xx-file-open.go b/056-file-open.go similarity index 100% rename from xx-file-open.go rename to 056-file-open.go diff --git a/xx-file-read.go b/057-file-read.go similarity index 100% rename from xx-file-read.go rename to 057-file-read.go diff --git a/xx-file-write.go b/058-file-write.go similarity index 100% rename from xx-file-write.go rename to 058-file-write.go diff --git a/xx-flags.go b/059-flags.go similarity index 100% rename from xx-flags.go rename to 059-flags.go diff --git a/xx-http-client-basic.go b/060-http-client-basic.go similarity index 100% rename from xx-http-client-basic.go rename to 060-http-client-basic.go diff --git a/xx-http-client.go b/061-http-client.go similarity index 100% rename from xx-http-client.go rename to 061-http-client.go diff --git a/xx-http-server-basic.go b/062-http-server-basic.go similarity index 100% rename from xx-http-server-basic.go rename to 062-http-server-basic.go diff --git a/xx-http-server-canonical-host.go b/063-http-server-canonical-host.go similarity index 100% rename from xx-http-server-canonical-host.go rename to 063-http-server-canonical-host.go diff --git a/xx-http-server-graceful-shutdown.go b/064-http-server-graceful-shutdown.go similarity index 100% rename from xx-http-server-graceful-shutdown.go rename to 064-http-server-graceful-shutdown.go diff --git a/xx-http-server-log.go b/065-http-server-log.go similarity index 100% rename from xx-http-server-log.go rename to 065-http-server-log.go diff --git a/xx-http-server-middleware.go b/066-http-server-middleware.go similarity index 100% rename from xx-http-server-middleware.go rename to 066-http-server-middleware.go diff --git a/xx-http-server-routing.go b/067-http-server-routing.go similarity index 100% rename from xx-http-server-routing.go rename to 067-http-server-routing.go diff --git a/xx-http-server-static-dynamic.go b/068-http-server-static-dynamic.go similarity index 100% rename from xx-http-server-static-dynamic.go rename to 068-http-server-static-dynamic.go diff --git a/xx-http-server-static-select.go b/069-http-server-static-select.go similarity index 100% rename from xx-http-server-static-select.go rename to 069-http-server-static-select.go diff --git a/xx-http-server-static.go b/070-http-server-static.go similarity index 100% rename from xx-http-server-static.go rename to 070-http-server-static.go diff --git a/xx-http-server-status-code.go b/071-http-server-status-code.go similarity index 100% rename from xx-http-server-status-code.go rename to 071-http-server-status-code.go diff --git a/xx-http-server.go b/072-http-server.go similarity index 100% rename from xx-http-server.go rename to 072-http-server.go diff --git a/xx-https-client.go b/073-https-client.go similarity index 100% rename from xx-https-client.go rename to 073-https-client.go diff --git a/xx-https-server.go b/074-https-server.go similarity index 100% rename from xx-https-server.go rename to 074-https-server.go diff --git a/xx-json.go b/075-json.go similarity index 100% rename from xx-json.go rename to 075-json.go diff --git a/xx-number-parsing.go b/076-number-parsing.go similarity index 100% rename from xx-number-parsing.go rename to 076-number-parsing.go diff --git a/xx-postgres.go b/077-postgres.go similarity index 100% rename from xx-postgres.go rename to 077-postgres.go diff --git a/xx-rand.go b/078-rand.go similarity index 100% rename from xx-rand.go rename to 078-rand.go diff --git a/xx-rate-limiting.go b/079-rate-limiting.go similarity index 100% rename from xx-rate-limiting.go rename to 079-rate-limiting.go diff --git a/xx-redis.go b/080-redis.go similarity index 100% rename from xx-redis.go rename to 080-redis.go diff --git a/xx-regexs.go b/081-regexs.go similarity index 100% rename from xx-regexs.go rename to 081-regexs.go diff --git a/xx-scatter-gather.go b/082-scatter-gather.go similarity index 100% rename from xx-scatter-gather.go rename to 082-scatter-gather.go diff --git a/xx-sha1.go b/083-sha1.go similarity index 100% rename from xx-sha1.go rename to 083-sha1.go diff --git a/xx-signals.go b/084-signals.go similarity index 100% rename from xx-signals.go rename to 084-signals.go diff --git a/xx-sort.go b/085-sort.go similarity index 100% rename from xx-sort.go rename to 085-sort.go diff --git a/xx-sortby.go b/086-sortby.go similarity index 100% rename from xx-sortby.go rename to 086-sortby.go diff --git a/xx-spawn.go b/087-spawn.go similarity index 100% rename from xx-spawn.go rename to 087-spawn.go diff --git a/xx-string-formatting.go b/088-string-formatting.go similarity index 100% rename from xx-string-formatting.go rename to 088-string-formatting.go diff --git a/xx-tcp-client.go b/089-tcp-client.go similarity index 100% rename from xx-tcp-client.go rename to 089-tcp-client.go diff --git a/xx-tcp-server.go b/090-tcp-server.go similarity index 100% rename from xx-tcp-server.go rename to 090-tcp-server.go diff --git a/xx-tickers.go b/091-tickers.go similarity index 100% rename from xx-tickers.go rename to 091-tickers.go diff --git a/xx-time.go b/092-time.go similarity index 100% rename from xx-time.go rename to 092-time.go diff --git a/xx-timers.go b/093-timers.go similarity index 100% rename from xx-timers.go rename to 093-timers.go diff --git a/xx-url.go b/094-url.go similarity index 100% rename from xx-url.go rename to 094-url.go diff --git a/xx-users.go b/095-users.go similarity index 100% rename from xx-users.go rename to 095-users.go diff --git a/xx-worker-pool.go b/096-worker-pool.go similarity index 100% rename from xx-worker-pool.go rename to 096-worker-pool.go diff --git a/tool/renumber.go b/tool/renumber.go index f5e7071..2b6ac10 100644 --- a/tool/renumber.go +++ b/tool/renumber.go @@ -8,6 +8,7 @@ import ( "io/ioutil" "strings" "regexp" + "os" ) func main() { @@ -38,7 +39,7 @@ func main() { // rename some stuff for index, indexName := range indexNames { oldName := sourceMap[indexName] - newName := fmt.Sprintf("%d-%s.go", index+1, indexName) + newName := fmt.Sprintf("%03d-%s.go", index+1, indexName) os.Rename(oldName, newName) } }