[go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-13 Thread Igor Maznitsa
Hello All

the 2.2.0 version of the maven golang plugin 
 has been published in the maven 
central

the main new feature - now the work with dependencies is much easier and 
they can be defined through external file (example 

).
The Plug-in allows to build Golang projects and provides way to work with 
single-module and multi-module Golang projects containing common part (
example 
),
 
it automatically loads needed Golang SDK version and auto-tunes environment 
variables what makes it very helpful for CI systems. 
It supports work with CVS systems (example 
)
 
and provides way to load packages not only by their name but also by their 
revision, branch and tag. As very big plus It allows to use whole power of 
already existing Java tools and frameworks (of course only during build 
time) in own projects (like use of ANTLR 

 
, preprocessing 

 
or web-UI build ).
Some big projects already use the plug-in, for instance keycloak 
 uses it for test purposes.

for fast start you can take a look at the example project 


the plug-in needs installed Java 1.7+ and Maven 3.0+

-- 
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.


Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread Ian Lance Taylor
On Sun, May 13, 2018 at 1:01 PM,   wrote:
>> Why would you assume more liability than necessary?
>
>
> My thought is the authors want to gain serious users to increase feedback
> quality and improve the developer market. I thought this was why Google let
> Go be open source besides attracting academic uses.
>
>> And as an open source developer who does not get paid, I feel better if
>> I have no liability whatsoever. Now, if you were PAYING ME for my
>> services, then I will be happy to provide you with assurances that make
>> you feel better.
>
>
> I don't think this is the attitude behind GCC, or maybe it is. I want to
> write programs that do things worth money and hope to use Go or GCC to do so
> (including working with and on those projects for free), but if they might
> include unnecessary liability beyond regular bugs then that's a problem for
> me.

Both Go and GCC get an advantage from using widely-used and
well-understood free software licenses.  Making any modification to
those licenses would force every large organization that wants to use
these tools to reanalyze the license to make sure it will be
acceptable.  So the place to change this, if you think there is a need
to change it, is not with individual projects, but with an umbrella
organization like the Free Software Foundation or the Open Source
Initiative.

Ian

-- 
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.


Re: [go-nuts] Digest for golang-nuts@googlegroups.com - 18 updates in 9 topics

2018-05-13 Thread Pete Wilson
All this is true.
But I expect that one of these fine days, someone sueable is going to ship 
software with a serious bug, and are going to get sued and lose because
(i) there’s a lot of money
and 
(ii) it’s well known in the art that doing X is just bloody stupid, and you did 
X.

And then the quality of software will improve, because not everybody can afford 
a few billion

— P

> On May 13, 2018, at 6:27 PM, golang-nuts@googlegroups.com wrote:
> 
> I would point out that a complete disclaimer of liability is fairly common
> even in commercial relationships. Just now I downloaded my motherboard's
> manual, and had to click through a liability and fitness-for-purpose
> disclaimer. So, even someone selling you a $300 enterprise motherboard
> doesn't want to be responsible for ensuring *you* are using it in a
> sensible fashion.
>  

-- 
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.


[go-nuts] Why does unmarshalling this API response return an unexpected EOF?

2018-05-13 Thread ivanchenko . luke
Hi all,

I'm creating a microservice in Go, using protocol buffers and gRPC. It 
interacts with a third-party API (Snooth) and I'm trying to unmarshal the 
JSON response into a protobuf struct I've created, using the proto package.

Unmarshalling returns an unexpected EOF error.


I've summed up the details in full on this question at Stack Overflow: 
https://stackoverflow.com/questions/50314476/why-does-unmarshalling-this-api-response-return-an-unexpected-eof


In addition to the information posted there, I've also tried using 
strconv.Unquote before unmarshalling in line with the idea that the escaped 
characters in the API response are causing a double-encode. But this didn't 
work either.

Any help would be greatly appreciated as I've been stuck on this for a 
while now and feel there's something simple I'm missing.


Thanks.

-- 
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.


[go-nuts] ROC (Request-Oriented Collector)

2018-05-13 Thread Tanya Borisova
Hi!

Is Golang team still working on Request-Oriented Collector? Is there any 
update on it? Quick search in golang-nuts and golang-dev didn't yield any 
new updates.

If not, it would be very interesting to hear why not and what Golang GC 
team is working on next.

Thanks,
Tanya

-- 
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.


Re: [go-nuts] os/exec always fails with fork/exec /usr/bin/qemu-img: invalid argument

2018-05-13 Thread Zhang Qiang
Hi Matthias,

Ian was right, the reason was the NUL bytes in the parameters. The
parameters were from a socket with extra NUL bytes and I forgot to
trim them.

Thanks for your advice anyway (:

On 14 May 2018 at 01:27, Matthias B.  wrote:
> On Fri, 11 May 2018 20:36:18 -0700 (PDT)
> Tashi Lu  wrote:
>
>> Hi gophers,
>>
>> I faced a strange problem: os/exec always fails with `fork/exec
>> /usr/bin/qemu-img: invalid argument'.
>>
>> Simplified code is at https://play.golang.org/p/v1APfzmS2p9. It seems
>> this simplified snippet runs well without errors, but my real code is
>> no more than just some variable initializations than this snippet. So
>> I suspect it's the context's problem, but my context is too complex
>> to simplify and put onto the playground. What I can think of that
>> what might be linked to this error is that this function is run in a
>> goroutine. But I did write a simplified goroutine version, sadly it
>> worked well too... I had no idea how to do further debugging.
>>
>> And further, the executable is not to blame, it fails with the same
>> error even if I substitute the executable to `ls' or anything else.
>
> Try deleting the relevant lines of code and then write them again,
> actually type them again, without referring to and especially not
> copy'n'pasting code from somewhere else. Sounds stupid I know, but I've
> given this advice many times over the years and it has an extremely
> high success rate in the situation you're describing.
>
> MSB
>
> --
> Light travels faster than sound. This is why some people appear bright
> until you hear them speak.
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "golang-nuts" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/golang-nuts/3aKF5NonPUc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.


Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread Dan Kortschak
Who would determine whether an mistaken action was intentional? This
seems like a very dangerous inclusion.

On Sun, 2018-05-13 at 08:56 -0700, matthewju...@gmail.com wrote:
> THE AUTHORS OF THIS SOFTWARE DID NOT INTENTIONALLY MAKE MISTAKES OR
> INCLUDE 
> PRACTICAL JOKES.
> 
> I’m not a lawyer, but I’d feel better about these tools if there was 
> something like that followed by the fitness disclaimer.

-- 
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.


Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread David Anderson
I would point out that a complete disclaimer of liability is fairly common
even in commercial relationships. Just now I downloaded my motherboard's
manual, and had to click through a liability and fitness-for-purpose
disclaimer. So, even someone selling you a $300 enterprise motherboard
doesn't want to be responsible for ensuring *you* are using it in a
sensible fashion.

- Dave

On Sun, May 13, 2018 at 2:45 PM, Gerald Henriksen 
wrote:

> On Sun, 13 May 2018 13:01:46 -0700 (PDT), you wrote:
>
> >I don't think this is the attitude behind GCC, or maybe it is. I want to
> >write programs that do things worth money and hope to use Go or GCC to do
> >so (including working with and on those projects for free), but if they
> >might include unnecessary liability beyond regular bugs then that's a
> >problem for me.
>
> I suspect you are worrying too much given both the long history of
> open source software and the large number of
> groups/organizations/companies that rely on it.
>
> But you aren't going to get much in the way of guarantees when you
> receive and use something for free.
>
> If you really feel you need some sort of legal guarantee then I
> suggest you look into some paid options that provide Go and/or GCC,
> such as Red Hat or Ubuntu, where there may be more of a legal
> framework that is more to your liking.
>
> --
> 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.
>

-- 
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.


Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread Gerald Henriksen
On Sun, 13 May 2018 13:01:46 -0700 (PDT), you wrote:

>I don't think this is the attitude behind GCC, or maybe it is. I want to 
>write programs that do things worth money and hope to use Go or GCC to do 
>so (including working with and on those projects for free), but if they 
>might include unnecessary liability beyond regular bugs then that's a 
>problem for me.

I suspect you are worrying too much given both the long history of
open source software and the large number of
groups/organizations/companies that rely on it.

But you aren't going to get much in the way of guarantees when you
receive and use something for free.

If you really feel you need some sort of legal guarantee then I
suggest you look into some paid options that provide Go and/or GCC,
such as Red Hat or Ubuntu, where there may be more of a legal
framework that is more to your liking.

-- 
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.


[go-nuts] Re: Does the CanSet and CanAddr methods of a reflect.Value always return the same result?

2018-05-13 Thread Juliusz Chroboczek
>> https://play.golang.org/p/f_qy1ZI56w7 

> Got it, thanks. 

It took me a while.  I think the point Ian is making is that an
unexported field is not CanSet.

-- 
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.


[go-nuts] [ANN] Dependencies for dummies

2018-05-13 Thread Gerardo Oscar JT
Hi gophers!

Golang do not have a canonical way to download dependencies. Glide is the 
last one I have been using and it is like a drunk elephant in my laptop.

This weekend I have managed to summon the force to work on a silly script 
that read a list of git repos, and do the clones, one by one.

For the moment it supports:

   - Clone a specific git repo inside a specific directory (removing the 
   .git folder)
   - Pin a specific tag/branch/commit
   - Select a specific file or directory inside a repo to avoid cloning all 
   the repo
   - Comments prefixed with # are suported

The project is called *golla*, here is the repo: 
https://github.com/fulldump/golla 

All dependencies should be specified in a file called golla like this:

# This is a golla file!
# First, we will clone a repo to a dir:
g...@github.com:fulldump/goconfig.git* ->* 
src/vendor/github.com/fulldump/goconfig

# Here we will clone a specific version:
g...@github.com:fulldump/golax.git*#**v0.6.1* -> 
src/vendor/github.com/fulldump/golax

# Only a file is cloned here (for example, golla script itself):
g...@github.com:fulldump/golla.git*>golla.go* -> golla.go


I hope this script could be helpful for anyone else.

Happy to learn from your feedback,
Fulldump


-- 
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.


Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread matthewjuran

>
> Why would you assume more liability than necessary?


My thought is the authors want to gain serious users to increase feedback 
quality and improve the developer market. I thought this was why Google let 
Go be open source besides attracting academic uses.

And as an open source developer who does not get paid, I feel better if 
> I have no liability whatsoever. Now, if you were PAYING ME for my 
> services, then I will be happy to provide you with assurances that make 
> you feel better. 


I don't think this is the attitude behind GCC, or maybe it is. I want to 
write programs that do things worth money and hope to use Go or GCC to do 
so (including working with and on those projects for free), but if they 
might include unnecessary liability beyond regular bugs then that's a 
problem for me.

Matt

On Sunday, May 13, 2018 at 12:39:05 PM UTC-5, Matthias B. wrote:
>
> On Sun, 13 May 2018 08:56:08 -0700 (PDT) 
> matthe...@gmail.com  wrote: 
>
> > My tools are my responsibility, so I’m wondering what stops the GCC, 
> > Go, or other open source authors from including practical jokes. 
>
> That depends on the jurisdiction and the kind of practical joke. But 
> it's a fact that software has contained practical jokes in the past, in 
> particular in cases where the software determined that it was running 
> without a proper license. So this does indeed happen and I've not heard 
> of any developer being sued for it. 
>
> > These license terms seem to remove all responsibility, and in certain 
> > hands that is an opportunity to cause some chaos. Why isn’t there a 
> > license section about intention of code implementation matching 
> > stated goals? 
>
> Ask yourself: If you can choose between having NO LIABILITY and having 
> just a little bit of liability, which option do you choose? Why would 
> you assume more liability than necessary? Are you Jesus or Gandhi? 
>
> > 
> > THE AUTHORS OF THIS SOFTWARE DID NOT INTENTIONALLY MAKE MISTAKES OR 
> > INCLUDE PRACTICAL JOKES. 
> > 
> > I’m not a lawyer, but I’d feel better about these tools if there was 
> > something like that followed by the fitness disclaimer. 
>
> And as an open source developer who does not get paid, I feel better if 
> I have no liability whatsoever. Now, if you were PAYING ME for my 
> services, then I will be happy to provide you with assurances that make 
> you feel better. 
>
>
>
> MSB 
>
> -- 
> A naked man with a can of beans can eat only one meal 
> but play a hundred soccer games. 
>
>

-- 
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.


[go-nuts] Re: I don't know about callbacks in Golang

2018-05-13 Thread Eduardo Moseis Fuentes
thanks it was useful
>
>
>
>

-- 
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.


[go-nuts] Actually I'm learning golang but I need involve me a project. do you guys know about a project to help it?

2018-05-13 Thread Eduardo Moseis Fuentes
I need to practice learning but also learn more please if someone can help 
me. I will be grateful. Greetings from Guatemala

-- 
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.


Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread Matthias B.
On Sun, 13 May 2018 08:56:08 -0700 (PDT)
matthewju...@gmail.com wrote:

> My tools are my responsibility, so I’m wondering what stops the GCC,
> Go, or other open source authors from including practical jokes.

That depends on the jurisdiction and the kind of practical joke. But
it's a fact that software has contained practical jokes in the past, in
particular in cases where the software determined that it was running
without a proper license. So this does indeed happen and I've not heard
of any developer being sued for it.

> These license terms seem to remove all responsibility, and in certain
> hands that is an opportunity to cause some chaos. Why isn’t there a
> license section about intention of code implementation matching
> stated goals?

Ask yourself: If you can choose between having NO LIABILITY and having
just a little bit of liability, which option do you choose? Why would
you assume more liability than necessary? Are you Jesus or Gandhi? 

> 
> THE AUTHORS OF THIS SOFTWARE DID NOT INTENTIONALLY MAKE MISTAKES OR
> INCLUDE PRACTICAL JOKES.
> 
> I’m not a lawyer, but I’d feel better about these tools if there was 
> something like that followed by the fitness disclaimer.

And as an open source developer who does not get paid, I feel better if
I have no liability whatsoever. Now, if you were PAYING ME for my
services, then I will be happy to provide you with assurances that make
you feel better.



MSB

-- 
A naked man with a can of beans can eat only one meal
but play a hundred soccer games.

-- 
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.


Re: [go-nuts] os/exec always fails with fork/exec /usr/bin/qemu-img: invalid argument

2018-05-13 Thread Matthias B.
On Fri, 11 May 2018 20:36:18 -0700 (PDT)
Tashi Lu  wrote:

> Hi gophers,
> 
> I faced a strange problem: os/exec always fails with `fork/exec 
> /usr/bin/qemu-img: invalid argument'. 
> 
> Simplified code is at https://play.golang.org/p/v1APfzmS2p9. It seems
> this simplified snippet runs well without errors, but my real code is
> no more than just some variable initializations than this snippet. So
> I suspect it's the context's problem, but my context is too complex
> to simplify and put onto the playground. What I can think of that
> what might be linked to this error is that this function is run in a
> goroutine. But I did write a simplified goroutine version, sadly it
> worked well too... I had no idea how to do further debugging.
> 
> And further, the executable is not to blame, it fails with the same
> error even if I substitute the executable to `ls' or anything else.

Try deleting the relevant lines of code and then write them again,
actually type them again, without referring to and especially not
copy'n'pasting code from somewhere else. Sounds stupid I know, but I've
given this advice many times over the years and it has an extremely
high success rate in the situation you're describing.

MSB

-- 
Light travels faster than sound. This is why some people appear bright
until you hear them speak.

-- 
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.


[go-nuts] Go license and fitness for purpose

2018-05-13 Thread matthewjuran
Hello,

The gccgo license has this section:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


This seems like a common pattern in open source software. GCC files include 
this:

GCC is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> GNU General Public License for more details.


I’ve been using the MIT license which has this:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS IN THE SOFTWARE.


My tools are my responsibility, so I’m wondering what stops the GCC, Go, or 
other open source authors from including practical jokes. These license 
terms seem to remove all responsibility, and in certain hands that is an 
opportunity to cause some chaos. Why isn’t there a license section about 
intention of code implementation matching stated goals?

THE AUTHORS OF THIS SOFTWARE DID NOT INTENTIONALLY MAKE MISTAKES OR INCLUDE 
PRACTICAL JOKES.

I’m not a lawyer, but I’d feel better about these tools if there was 
something like that followed by the fitness disclaimer.

Matt

-- 
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.


[go-nuts] Re: Behavior of DotReader

2018-05-13 Thread Constantin Konstantinidis
Hello,

RFC 5321 states in 3.3 : "If the mailbox specification is not acceptable for

   some reason, the server MUST return a reply indicating whether the
   failure is permanent (i.e., will occur again if the client tries to
   send the same address again) or temporary (i.e., the address might be
   accepted if the client tries again later).

"

In other words, waiting to complete the DotReader operation seems appropriate 
unless canceling of the operation is explicit to allow a failure message.


Regards,




On Monday, May 7, 2018 at 7:39:52 PM UTC+2, julianweise wrote:
>
> Hey guys,
>
> I am not quite sure whether the following behavior is intended or not. 
> Therefore, I am seeking for your advice.
>
> Using DotReader's Read() function from the textproto package requires me 
> to provide an predefined buffer to fill in processed data (as usual for 
> Read() functions).
> Let's consider the case I provided a small buffer (in my case for a smtp 
> server only supporting small mails) but we receive a big mail.
> The Read() function of DotReader terminates it's foor loop providing no 
> error (nil). The textproto Reader still has it's DotReader initialized 
> (net/textproto line 20).
> As a result of this, all other Read functions of the textproto reader now 
> try finalize the DotReader operation fist (by calling closeDot()). 
> CloseDot() calls Read() of the DotReader which will only finish 
> successfully (and setting dotReader to nil) when it detects an dot.
> So, no other operation on the textproto Reader is possible until an dot 
> has been detected.
>
> I am wondering whether this is intended behavior? Isn't the assumption 
> valid to just read a certain amount of data and cancel the entire operation 
> if an certain threshold is reached, still being able to use the reader for 
> other operations afterwords?
>
> I would be grateful for any input concerning this topic.
>
> Cheers,
>
> Julian
>

-- 
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.


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

2018-05-13 Thread Janne Snabb
On 2018-05-13 11:34, Hugh Fisher wrote:
> I still think a while  { ... } loop would be a worthwhile
> addition, for the reasons I've already given.

Your reason from the original post was: "I know it's possible to use a
for, but it doesn't feel right to me."

It is not reasonable to demand everyone else in the world to change to
behave according to your feelings. It is much less waste of resources
that you just learn to align your own feelings to match the world around
you.

I am sure there are also people in the world who feel that "let" would
be better than "var" and "mitähäh?" would be better than "if". Should
the language also be changed to accommodate those feelings? Obviously not.


Janne Snabb
sn...@epipe.com

-- 
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.


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

2018-05-13 Thread Louki Sumirniy
I don't understand why you are saying this after how many times so many 
people have pointed out that

  while Condition() { ... }

is expressed as

  for Condition() { ... }

The for statement with a single clause IS a while loop. You can make it 
explicit by putting semicolons on each side of the condition expression but 
it's not necessary.

The only thing you can't do without an if statement at the end of a for 
statement block is exactly

  do { ... } while Condition()

style 'run once before condition check.

Which has to be done this way:

  for {
...
if Condition() {
  break
}
  }

and for { ... } is equivalent to while true { ... } infinite loop (notice 
how it's shorter?)

On Sunday, 13 May 2018 11:34:10 UTC+3, Hugh Fisher wrote:
>
>
>
> On Sunday, May 13, 2018 at 1:20:16 AM UTC+10, matthe...@gmail.com wrote:
>>
>> It's certainly diverged from my original post, which is why I'm staying 
>>> quiet.
>>
>>
>> I was hoping to get back on track after you sent this so you’d want to 
>> participate.
>>
>
> I still think a while  { ... } loop would be a worthwhile 
> addition, for the reasons I've already given.
>
> However I don't see the need for an "at least once" do { ... } while 
>  loop, and even less need for more exotic loop constructs. So I 
> really don't have anything more to add. Thanks for replying to my original 
> post.
>
> cheers,
> Hugh Fisher
>  
>

-- 
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.


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

2018-05-13 Thread Hugh Fisher


On Sunday, May 13, 2018 at 1:20:16 AM UTC+10, matthe...@gmail.com wrote:
>
> It's certainly diverged from my original post, which is why I'm staying 
>> quiet.
>
>
> I was hoping to get back on track after you sent this so you’d want to 
> participate.
>

I still think a while  { ... } loop would be a worthwhile 
addition, for the reasons I've already given.

However I don't see the need for an "at least once" do { ... } while 
 loop, and even less need for more exotic loop constructs. So I 
really don't have anything more to add. Thanks for replying to my original 
post.

cheers,
Hugh Fisher
 

-- 
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.