Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(678)

Issue 111250043: code review 111250043: go-tour: move code snippets to article-specific directories (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by adg
Modified:
9 years, 10 months ago
Reviewers:
campoy
CC:
campoy, golang-codereviews
Visibility:
Public.

Description

go-tour: move code snippets to article-specific directories As the prog/tour directory grows it becomes more difficult to see what belongs where. Also the prog/tour directory hierarchy is one level too deep. Here's the code used to make this change: for article in *.article; do base=$(echo $article | sed 's/.article//') mkdir $base gofiles=$(grep '^.play' $article | awk '{print $2}' | sed 's_prog/tour/__' | sort -u) for f in $gofiles; do hg mv prog/tour/$f $base/$f done sed -i '' 's_prog/tour_'$base'_' $article done # catch dreg masked by "#appengine: " comment directive hg mv prog/tour/sandbox.go welcome/

Patch Set 1 #

Patch Set 2 : diff -r ff9df8631195 https://code.google.com/p/go-tour #

Patch Set 3 : diff -r ff9df8631195 https://code.google.com/p/go-tour #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M content/basics.article View 14 chunks +14 lines, -14 lines 0 comments Download
M content/basics/basic-types.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/constants.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/exported-names.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/functions.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/functions-continued.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/imports.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/multiple-results.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/named-results.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/numeric-constants.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/packages.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/short-variable-declarations.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/type-conversions.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/variables.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/basics/variables-with-initializers.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency.article View 8 chunks +8 lines, -8 lines 0 comments Download
M content/concurrency/buffered-channels.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/channels.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/default-selection.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/exercise-equivalent-binary-trees.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/exercise-web-crawler.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/goroutines.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/range-and-close.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/concurrency/select.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol.article View 9 chunks +14 lines, -14 lines 0 comments Download
M content/flowcontrol/defer.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/defer-multi.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/exercise-loops-and-functions.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/for.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/for-continued.go View 1 chunk +1 line, -1 line 0 comments Download
M content/flowcontrol/for-is-gos-while.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/forever.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/if.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/if-and-else.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/if-with-a-short-statement.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/switch.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/switch-evaluation-order.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/flowcontrol/switch-with-no-condition.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods.article View 12 chunks +12 lines, -12 lines 0 comments Download
M content/methods/errors.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/exercise-errors.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/exercise-http-handlers.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/exercise-images.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/exercise-rot-reader.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/images.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/interfaces.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/interfaces-are-satisfied-implicitly.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/methods.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/methods-continued.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/methods-with-pointer-receivers.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/methods/web-servers.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes.article View 17 chunks +22 lines, -22 lines 0 comments Download
M content/moretypes/append.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/array.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/exercise-fibonacci-closure.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/exercise-maps.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/exercise-slices.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/function-closures.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/function-values.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/making-slices.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/map-literals.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/map-literals-continued.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/maps.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/mutating-maps.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/nil-slices.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/pointers.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/range.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/range-continued.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/slices.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/slicing-slices.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/struct-fields.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/struct-literals.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/struct-pointers.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/moretypes/structs.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/welcome.article View 2 chunks +2 lines, -2 lines 0 comments Download
M content/welcome/hello.go View 0 chunks +-1 lines, --1 lines 0 comments Download
M content/welcome/sandbox.go View 0 chunks +-1 lines, --1 lines 0 comments Download

Messages

Total messages: 4
adg
Hello campoy (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go-tour
9 years, 10 months ago (2014-07-17 03:34:53 UTC) #1
campoy
On 2014/07/17 03:34:53, adg wrote: > Hello campoy (cc: mailto:golang-codereviews@googlegroups.com), > > I'd like you ...
9 years, 10 months ago (2014-07-17 20:17:31 UTC) #2
adg
I will wait for you to land your defer change before submitting. Rietveld doesn't show ...
9 years, 10 months ago (2014-07-17 21:15:29 UTC) #3
adg
9 years, 10 months ago (2014-07-23 03:48:00 UTC) #4
*** Submitted as https://code.google.com/p/go-tour/source/detail?r=04766421959a
***

go-tour: move code snippets to article-specific directories

As the prog/tour directory grows it becomes more difficult to see
what belongs where. Also the prog/tour directory hierarchy is one
level too deep.

Here's the code used to make this change:

        for article in *.article; do
                base=$(echo $article | sed 's/.article//')
                mkdir $base
                gofiles=$(grep '^.play' $article | awk '{print $2}' | sed
's_prog/tour/__' | sort -u)
                for f in $gofiles; do
                        hg mv prog/tour/$f $base/$f
                done
                sed -i '' 's_prog/tour_'$base'_' $article
        done

        # catch dreg masked by "#appengine: " comment directive
        hg mv prog/tour/sandbox.go welcome/

LGTM=campoy
R=campoy
CC=golang-codereviews
https://codereview.appspot.com/111250043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b