Re: [go-nuts] Please help me solve a bug with my licencing system!

2018-05-10 Thread Burak Serdar
It is likely that HashDecoded is "" (line 28) because hex.DecodeString() fails, so password check never fails. On Thu, May 10, 2018 at 7:46 PM, wrote: > Hello all, > > I am creating a simple licencing system to help licence my own programs and > also to help others via

[go-nuts] Please help me solve a bug with my licencing system!

2018-05-10 Thread atighe
Hello all, I am creating a simple licencing system to help licence my own programs and also to help others via github. I have come across a bug that I don't really understand and am asking for some advice. I will add the client code soon. I also hope to add more advanced features.

[go-nuts] tcp session stay for a while when http.do fails

2018-05-10 Thread richard . weiyang
Hi, I am facing an error "socket, too many open files". By lsof, I found there are a lot of sessions in ESTABLISHED state. Then I tried to write a small program which just do http GET. After I add the timeout, connect close fields as someone else mentioned, I do see the session closed

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Devon H. O'Dell
Interesting. I've never had that experience in the past 15ish years doing POSIXish systems stuff. I've always found it the more natural expression for handling EINTR from syscalls like read/write. I've also never seen anyone seriously discourage its use in ##c on freenode over the same-ish

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Michael Jones
*always as in, from learn on 6th edition at BTL in 1977. On Thu, May 10, 2018 at 3:29 PM Michael Jones wrote: > So sorry to learn of your mistreatment. I've never been struggled in an > anti-do-while cultural revolution, though I can imagine the lasting > emotional

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Michael Jones
So sorry to learn of your mistreatment. I've never been struggled in an anti-do-while cultural revolution, though I can imagine the lasting emotional harm. I always* thought that C's "do {stuff} while (cond);" was a victim of syntax. The cond is far away and hidden from the do. An idea from the

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Rob Pike
There is a widespread dislike of do-while in C. Pretty much every time I've wanted it, my code reviewer made me take it out. I agree it has its place but it's one of those style things that social pressures seem to force. I would not be the one to try to argue for its return; I couldn't handle the

Re: [go-nuts] Bug or not?

2018-05-10 Thread Jan Mercl
On Thu, May 10, 2018 at 1:00 PM roger peppe wrote: > "The scope of a type identifier declared inside a function begins at > the identifier in the TypeSpec and ends at the end of the innermost > containing block." That's it, thanks. Got bitten by the difference wrt variable

[go-nuts] Re: Differences between os, io, ioutils, bufio, bytes (with Buffer type) packages for file reading

2018-05-10 Thread zhouhongyu1989
Your answer is awesome, thank you 在 2014年2月26日星期三 UTC+13上午6:58:27,Carlos Castillo写道: > > First of all, if you are presenting code, you should use playground links. > >- You shouldn't be using panic in load, filepath.Walk will return the >error that load returns if the error is not nil,

Re: [go-nuts] Bug or not?

2018-05-10 Thread Matthias B.
On Thu, 10 May 2018 08:33:32 + Jan Mercl <0xj...@gmail.com> wrote: > This modified example from another thread does not compile: You modified it in a pretty significant way. The original example had type T = *T which is a recursive type alias (which is disallowed). Your new example has

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Michael Jones
Maybe the central issue here has been lost because of the confusion between English words and the keywords of various languages. Let's be explicit: *a controlled looping construct may test the control condition before or after the iterated body of code. Go's 'for' tests before and and Go does not

[go-nuts] Re: Go could really use a while statement

2018-05-10 Thread matthewjuran
The lack of citations makes the content untrustworthy to me, but this English Wikipedia article on loops claims some history starting with the do loop in FORTRAN (1957): https://en.wikipedia.org/wiki/For_loop This article says the three part for loop was introduced in C/C++ (1972), and

Re: [go-nuts] Go could really use a while statement

2018-05-10 Thread Luis Furquim
I think the only real problem here is the lack of do {} while and even this is not a big problem. I think we can happily live with the solution pointed by Sokolov, which is the one I use when needed. But looking at this thread what pops up is that the lacking of this construct at the language

Re: [go-nuts] Bug or not?

2018-05-10 Thread roger peppe
The error seems correct to me. From the spec: "The scope of a type identifier declared inside a function begins at the identifier in the TypeSpec and ends at the end of the innermost containing block." So the type declaration in main is a recursive type - the T it refers to is not the previously

[go-nuts] Bug or not?

2018-05-10 Thread Jan Mercl
This modified example from another thread does not compile: package main import ( "fmt" ) type T int func main() { var v T type T *T var w T w = *w = v

Re: [go-nuts] Cyclic types

2018-05-10 Thread Jan Mercl
On Wed, May 9, 2018 at 7:45 PM Robert Griesemer wrote: > PS: Here's an example where we (humans) can obviously compute the size of a type, yet neither cmd/compile, gccgo, nor go/types have any success in doing so: > > type T struct { > a [10]int > b

Re: [go-nuts] Cyclic types

2018-05-10 Thread Jan Mercl
On Wed, May 9, 2018 at 7:01 PM Robert Griesemer wrote: > I think we also have been hesitant to simply disallow "cyclical types" (per your definition of cyclical) in the spec because we (or at least I) don't have a good understanding that our code actually detects exactly those.