[go-nuts] Re: Godoc / Local Project/ Documentation

2017-03-05 Thread Rejoy
Yes, this works and suffices my needs for now. So if I understand right, I should be creating just the single main package and import all other files as packages into the main package. Only then will the documentation show up for my local project as well. On Monday, March 6, 2017 at 2:42:19 AM

[go-nuts] Re: Is it a concurrency issue?

2017-03-05 Thread 詹青朋
Sorry for the misleading, these was a race condition, and I have found it. It's not about reading / writing to the same map. "this.Entries" is replaced by a new map in a timer, in another goroutine. 在 2017年3月3日星期五 UTC+8下午9:31:12,詹青朋写道: > > Hey guys, > > Here is my code, >

[go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-05 Thread Nick Rio
Thank you for reply. No guys, it's me using too many memories, not Goroutine. However, I believe if I can make those code in epoll-style, I can then build a task queue to handle those connections one by one in a queue when they back to active. For example, start one *accepter* goroutine + few

Re: [go-nuts] Tool to detect unused parameters

2017-03-05 Thread Ian Lance Taylor
On Sun, Mar 5, 2017 at 9:34 AM, Daniel Martí wrote: > > As a weekend project I've written a linter that detects unused > parameters: https://github.com/mvdan/unparam > > As many of you may know, this is tricky business because of interfaces > and build tags, among other things. So

Re: [go-nuts] Godoc / Local Project/ Documentation

2017-03-05 Thread Shawn Milochik
You can append this to the URL: ?m=src So this: http://localhost:9000/pkg/myapp becomes http://localhost:9000/pkg/myapp/?m=src From: https://godoc.org/golang.org/x/tools/cmd/godoc You can still only see exported functions. If you pull out the code you want to document into packages (other

Re: [go-nuts] Slice from interface doesn't work as expected

2017-03-05 Thread db047h
This happens only because z is copied every time, but has nothing to do with interfaces. This exhibits the same behavior without interface{}: https://play.golang.org/p/C5KoUST4Zn You could in fact modify the slice's existing content, but not the slice itself. For example: x := make([]int, 1,

[go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-05 Thread Manlio Perillo
Il giorno domenica 5 marzo 2017 16:13:08 UTC+1, Nick Rio ha scritto: > > Greeting people, > > *TL;DR: The only option is to work with syscall package and build > everything ground up, or there are some easier way?* > > The story is, I'm working on a network related project ( >

Re: [go-nuts] dh-golang usage

2017-03-05 Thread kvs
On Monday, March 6, 2017 at 12:13:44 AM UTC+3, Michael Stapelberg wrote: > > > > On Sun, Mar 5, 2017 at 9:14 PM, wrote: > >> Hi! >> >> Michael, thank you very much for your reply! override_dh_auto_install >> feature does helped eliminate Go sources from the final .deb

Re: [go-nuts] dh-golang usage

2017-03-05 Thread Michael Stapelberg
On Sun, Mar 5, 2017 at 9:14 PM, wrote: > Hi! > > Michael, thank you very much for your reply! override_dh_auto_install > feature does helped eliminate Go sources from the final .deb archive. > …why? Please describe what you did, what you expected, and what you see instead. >

[go-nuts] Godoc / Local Project/ Documentation

2017-03-05 Thread Rejoy
In my local project folder (a web app) that has the go source files, I use the go run command to get the output. Each of these files is called a package main. I 'd like to create the documentation for the project. I run godoc -http=:6060, but don't see any of the source files of my local

Re: [go-nuts] dh-golang usage

2017-03-05 Thread kvs
Hi! Michael, thank you very much for your reply! override_dh_auto_install feature does helped eliminate Go sources from the final .deb archive. As for dh-golang not being for the end users -- do you know any alternatives which are more suited for the end users for building .deb packages? On

[go-nuts] Re: Bots on the mailing list

2017-03-05 Thread Simon Ritchie
> Apparently they're all "yahoo" email addresses. Very few organisations supply free email addresses these days, pretty much only Google and Yahoo. A few years ago the project I was working on needed a constant supply of new email addresses for testing. They had to be real working email

[go-nuts] Re: Feedback on naming issue when interface vs main code struct

2017-03-05 Thread mlg
Henry, thank you; your first paragraph was the answer I was looking for. Sorry for explaining so poorly. If I understand you correctly, you don't feel super strongly about it but you reckon you'd suffix "Impl" to the struct as a general rule. You'd leave it to the programmers discretion,

Re: [go-nuts] dh-golang usage

2017-03-05 Thread Michael Stapelberg
dh-golang is not maintained by the Go team, so a better place to get support is the pkg-go-maintainers mailing list. 1. No, and given dh-golang’s scope, this won’t be added (it’s a tool for Debian development, not for end users). 2. No. Currently, we delete the source from binary-only packages,

Re: [go-nuts] Golang Interview Areas

2017-03-05 Thread Nyah Check
Thanks Shawn On Sun, Mar 5, 2017 at 7:50 PM, Shawn Milochik wrote: > I don't agree with the (admittedly assumed) premise that quizzing the > interviewee with Go specifics is the best, or even a very good, way to go. > > I just stumbled upon this today and recommend it: > >

Re: [go-nuts] Golang Interview Areas

2017-03-05 Thread Shawn Milochik
I don't agree with the (admittedly assumed) premise that quizzing the interviewee with Go specifics is the best, or even a very good, way to go. I just stumbled upon this today and recommend it: http://kolesky.com/datums/job-search/ I've also done a lot of interviewing and hiring. In my

Re: [go-nuts] sqlEZ: the easiest way to use a SQL database

2017-03-05 Thread jmacwhyte
Thanks Konstantin, This is the kind of feedback I was looking for! I forgot to include the link to my github repo in my original post (did you find it anyway?) so I'm not sure if you read my README. I took a look at sqlx before writing sqlez, and while sqlx is a great improvement over the

[go-nuts] Re: sqlEZ: the easiest way to use a SQL database

2017-03-05 Thread jmacwhyte
This is my first post to this mailing list, and wouldn't you know it, I totally forgot to include the link to the repo. Talk about a bad first impression! Here it is: https://github.com/jmacwhyte/sqlez On Saturday, March 4, 2017 at 9:25:29 PM UTC-8, jmacwhyte wrote: > > Hello all, > > After

Re: [go-nuts] Golang Interview Areas

2017-03-05 Thread Nyah Check
Is that so? :-) On Sun, Mar 5, 2017 at 6:51 PM, andrey mirtchovski wrote: > the first question i usually ask is "what's the name of the gopher" :) > > On Sun, Mar 5, 2017 at 10:50 AM, Nyah Check wrote: > > Hi Gophers, > > > > I am an entry SE and

[go-nuts] Docs - German translations updated

2017-03-05 Thread HaWe
The following translations have been updated to match Go 1.8: http://www.bitloeffel.de/DOC/golang/install_de.html http://www.bitloeffel.de/DOC/golang/install-source_de.html http://www.bitloeffel.de/DOC/golang/code_de.html http://www.bitloeffel.de/DOC/golang/effective_go_de.html

Re: [go-nuts] Golang Interview Areas

2017-03-05 Thread andrey mirtchovski
the first question i usually ask is "what's the name of the gopher" :) On Sun, Mar 5, 2017 at 10:50 AM, Nyah Check wrote: > Hi Gophers, > > I am an entry SE and I'm to interview someone to join our Golang Backend > team. I've told them I'm not experienced enough and they

[go-nuts] Golang Interview Areas

2017-03-05 Thread Nyah Check
Hi Gophers, I am an entry SE and I'm to interview someone to join our Golang Backend team. I've told them I'm not experienced enough and they refused. Can anyone please guide me on what to probe in any Golang Developer during the interview? Thanks, Nyah -- "The heaviest penalty for declining

[go-nuts] How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-05 Thread Tamás Gulácsi
Are you sure that those goroutines will consume too much memory? As the Go runtime implements a very sophisticated network stack on top of epoll, I wouldn't start from scratch, but use it, eliminating unneeded allocations (buffers). -- You received this message because you are subscribed to

[go-nuts] Tool to detect unused parameters

2017-03-05 Thread Daniel Martí
Hey all, As a weekend project I've written a linter that detects unused parameters: https://github.com/mvdan/unparam As many of you may know, this is tricky business because of interfaces and build tags, among other things. So the tool isn't free from false positives, and I don't think it could

[go-nuts] Re: Feedback on naming issue when interface vs main code struct

2017-03-05 Thread Henry
I would name your interface 'customer', the struct in the main code 'customerImpl' and the struct in the test code 'mockedCustomer'. However, we are dealing with unexported types here. I tend to be less picky about names for unexported types and prefer to leave them to each programmer's

[go-nuts] dh-golang usage

2017-03-05 Thread kvs
Hello! I am trying to learn how to use debhelper infrastructure to build Debian packages from Go code. I've install dh-golang and Go itself from jessie-backports and all seems to work quite well. But I'd like to change two things which don't fit well enough in my workflow. 1. Is there a way

[go-nuts] How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-05 Thread nickriose
Greeting people, *TL;DR: The only option is to work with syscall package and build everything ground up, or there are some easier way?* The story is, I'm working on a network related project (https://github.com/nickrio/coward) which been designed to take a lots of connections. Most of those

Re: [go-nuts] sqlEZ: the easiest way to use a SQL database

2017-03-05 Thread Tong Sun
Totally agree. On Sunday, March 5, 2017 at 9:10:26 AM UTC-5, Konstantin Khomoutov wrote: > > On Sun, 5 Mar 2017 12:42:24 +0200 > Janne Snabb wrote: > > > > After seeing a need for simplifying SQL databases in Go, I have > > > written a new package that makes it very easy to

Re: [go-nuts] sqlEZ: the easiest way to use a SQL database

2017-03-05 Thread Konstantin Khomoutov
On Sun, 5 Mar 2017 12:42:24 +0200 Janne Snabb wrote: > > After seeing a need for simplifying SQL databases in Go, I have > > written a new package that makes it very easy to do basic SELECT, > > INSERT, and UPDATE database operations. Essentially you define a > > struct that

[go-nuts] Dumbest golang mistakes

2017-03-05 Thread Tom
What are the dumbest, most obvious ways you have shot yourself in the foot? I just spend 3 hours debugging a network issue across three servers in dev, after copy-pasting some code from a crappy proof-of-concept into a complicated package with lots of modules. defer serverConn.Close() 1

Re: [go-nuts] sqlEZ: the easiest way to use a SQL database

2017-03-05 Thread Janne Snabb
Looks similar to https://github.com/jmoiron/sqlx which is well established. Might be a good idea to add a short summary of differences/additional benefits compared to sqlx in README. Janne Snabb sn...@epipe.com On 2017-03-05 01:36, jmacwhyte wrote: > Hello all, > > After seeing a need for

[go-nuts] Re: How Build New Golang Console App in a Main Go App?

2017-03-05 Thread Florin Pățan
You can make an auto-run generator without needing to compile an application. Create a custom DSL and have that distributed with a binary that can read it and behave accordingly. But if you do need that, for whatever reason, say allow more complex scenarios / higher degree of customization,

[go-nuts] How select mysql with Bind Param Using go

2017-03-05 Thread erfangnulinux
Hello, i want execute example `select * from where id=?` with bind param(s) and get `all rows`. https://github.com/go-sql-driver/mysql/wiki/Examples ``` db, err := sql.Open("mysql", "user:password@/dbname") if err != nil { panic(err.Error()) // Just for example purpose. You

[go-nuts] Re: How Build New Golang Console App in a Main Go App?

2017-03-05 Thread erfangnulinux
On Saturday, March 4, 2017 at 6:30:13 PM UTC+3:30, erfang...@gmail.com wrote: > > i want make a autorun generator , mean this make a string code and next > build output file(as golang). > > how can do this? > !!! -- You received this message because you are subscribed to the Google Groups