Don't do relative imports (littlelang/tokenizer) or . littlelang/tokenizer 
. Unless you want to run into corner cases with tools not knowing where 
code is defined or if you want to confuse other developers.

Using the full path makes it very clear where the code is, yes, if you move 
things around.refactor you may have to edit the path, but in Go it's not 
about saving the writer of code time, it's about saving all the readers of 
code time (including yourself in a year).

That's the only big thing I noticed on your project, the rest looks good.
One minor thing may be that instead of using os.Args, I would use the 
flag's package.


Best regards,

Diego

 

On Wednesday, December 13, 2017 at 9:27:08 AM UTC-5, matthe...@gmail.com 
wrote:
>
> I've used the full github path (github.com/benhoyt/littlelang/tokenizer) 
> for my subpackages when importing them but the tradeoffs for your approach (. 
> "littlelang/tokenizer") isn't clear to me.
>
> You've put care into error handling and unit testing and the code looks 
> maintainable as a professional project to me.
>
> Matt
>
> On Tuesday, December 12, 2017 at 6:31:54 PM UTC-6, Ben Hoyt wrote:
>>
>> Hi folks,
>>
>> I've recently been learning Go on the side, so haven't had work 
>> colleagues to discuss best practices with. To speed up the learning 
>> process, I'm wondering if anyone would like to review the Go code in my 
>> side project (a toy language, kind of a cross between JavaScript and Python 
>> with Go syntax). I'm not too interested in a review of the project itself, 
>> but simply a pure code review to help me grok Go idioms and best practices.
>>
>> I realize this may be a big request, but any pointers/feedback would be 
>> useful. Is anyone here interested in giving some feedback? Or if not, is 
>> there a better place to ask? I'm happy to contribute in a similar way to 
>> other people's projects too (though I'm more at home in Python right now). 
>> I thought about the Code Review Stackexchange, but that seems more for 
>> review of short code snippets.
>>
>> My project lives at: https://github.com/benhoyt/littlelang
>>
>> Thanks,
>> Ben
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to