The code in `replace.go` doesn't compile, because there are several
undefined names including CHAR_HEADER.
So I suspect that whatever your're running doesn't define the RE
you think it does.
Chris
--
Chris "allusive" Dollin
You didn't make it clear that replace.go was incomplete and that
you expected the gowizard git to be cloned. So I cloned it, go into
gowizard, make install:
6g -o _go_.6 main.go error.go flag.go metadata.go replace.go
template.go tmpl-data.go util.go
flag.go:20: can't find import: github.com/kless/go-readin/readin
make: *** [_go_.6] Error 1
OK so I have to do two goinstalls first. Then I can compile it, but
I don't know how to provoke it to get the error you mention.
Probably best if you can cut it down to a minimal example.
Chris
PS The README starts:
Tired of adding the same files every time you create a new Go project?
to which my automatic reply is "no" ...
--
Chris "allusive" Dollin
Yes you can, and you should.
Think about what your program is doing.
Put print statements in to verify that you're right.
If that's not enough, make a copy of your program,
edit it to hard-code whatever is necessary to trigger
the bug, and then run
make && 6.out
The bug should happen. Then start throwing away
code, moving things into a single file, and throwing
away more code, simplifying the program as much
as possible without eliminating the bug. During this
process it helps to be running
make && 6.out
after each change, ready to undo if you've lost the bug.
Repeat this until you've got the example cut down to
a single file program that is less than 20 lines long.
It's likely you'll figure out the bug before you get there,
in which case you can stop, fix it in the original, verify
that it's fixed, and then throw away the mangled copy.
But if you do get to a single file program that is less
than 20 lines, *then* mail the list, and include the entire
program, so that we can reproduce the bug too.
If it's not worth your time to go through this process,
to isolate the deterministic problem in a simple demonstration
program (and it's your program!), then it's likely not worth
our time either. Meet us halfway: we're happy to help but
you have to give us better examples.
The most important benefit of this process is that
nine times out of ten, you find the bug on your own,
which in the long term is typically more helpful than
just being told where the bug is.
Russ
That's what unit tests are for ...
(regexp gotchas are of course not specific to Go.)
It did show a warning.
You passed that warning to the regexp parser.
Russ
There seems to be something wrong with the documentation for fmt.Sprintf
http://golang.org/pkg/fmt/#Sprintf
func Sprintf(format string, a ...interface{}) string
Sprintf formats according to a format specifier and returns the
resulting string. It returns the number of bytes written.
But, It doesn't seem to "return the number of bytes written" at all.
The same problem exists with Sprintln and Sprint.
- jessta
--
=====================
http://jessta.id.au
-rob