Re: [go-nuts] Confusion about gcWork put in golang source code runtime/mgcwork.go

2018-08-17 Thread Tim Xu
I am too dumb that i thought it was a slice. Thanks a lot : )
On Fri, Aug 17, 2018 at 11:01 PM Ian Lance Taylor  wrote:

> On Fri, Aug 17, 2018 at 3:28 AM,   wrote:
> >
> > I am new to golang source code, and recently met a problem about
> > understanding golang gc.
> >
> > In runtime/mgcwork.go: 114
> >
> > func (w *gcWork) put(obj uintptr) {
> >flushed := false
> >wbuf := w.wbuf1
> >if wbuf == nil {
> >   w.init()
> >   wbuf = w.wbuf1
> >   // wbuf is empty at this point.
> >} else if wbuf.nobj == len(wbuf.obj) { // why is this the condition
> that
> > wbuf is full?
> >   ...
> >}
> >
> >
> >
> >
> > I don't understand why wbuf.nobj == len(wbuf.obj) is the condition that
> wbuf
> > is full. Any help makes sense to me.
>
> If you look at the definition of the workbuf type, you will see that
> the obj field is an array.  The nobj field counts the number of
> elements that have been put in the array.  When nobj is the length of
> the array, there is no room for any more elements.
>
> 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] To make AI with Golang

2018-08-17 Thread Shane
On Sat, Aug 18, 2018 at 2:56 PM John  wrote:
>
> Hi I am trying to make an game of Connect Five using Golang, I have 
> already made an player versus player mode so I am making the player versus 
> computer mode.

I think what you are looking for is adversarial graph search, min/max
with alpha/beta pruning

It's not (strictly speaking) Go specific, and a basic explanation can
be found at https://www.cs.cornell.edu/courses/cs312/2002sp/lectures/rec21.htm

You'll need to create a graph in memory with each node being a state
of the board, and each edge being a legal move out of the node into
another state. You'll also need to decide what constitutes a good move
(so you can award a 'strength' to each state, in one players favour or
the others) and finally you'll need to determine how many moves into
the future your application will search for it's optimal move. The
better your strength statistic is at determining optimal board states,
and the further into the future your graph will look, the better your
'AI' will be. But be aware that the limitations of time and memory
will constrain how far into the future you can look.

> At first I attempted to use if functions that detect when they need to block 
> the player but it can't win without placing blocks for itself. Also another 
> problem is that the computer have a chance on placing on the player's block. 
> So I need some help, I know you are all wonderful coders.
>
> --
> 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.


[go-nuts] To make AI with Golang

2018-08-17 Thread John
Hi I am trying to make an game of Connect Five using Golang, I have 
already made an player versus player mode so I am making the player versus 
computer mode. At first I attempted to use if functions that detect when 
they need to block the player but it can't win without placing blocks for 
itself. Also another problem is that the computer have a chance on placing 
on the player's block. So I need some help, I know you are all wonderful 
coders.

-- 
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] gocontracts: tool for design-by-contract

2018-08-17 Thread marko . ristin
Hi,

We've implemented a small tool to facilitate design-by-contract by 
generating code from the conditions described in the function descriptions. 
While others have implemented Go libraries (e.g., [1]), we wanted something 
that gives us readable code with no extra dependencies. Moreover, we found 
contracts to be highly relevant and wanted to have them synchronized with 
the documentation. 

So far, we found contracts not only to be valuable for validating the 
programs, but also as a means to formally document how the results are 
conditioned on the inputs ("if no error, then we expect the result to be 
...").

The github repository is:
https://github.com/Parquery/gocontracts

Any feedback and ideas are highly welcome!

[1] https://github.com/lpabon/godbc

Cheers,
Marko

-- 
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] How to find other packages using this package?

2018-08-17 Thread Ian Davis
On Fri, 17 Aug 2018, at 5:08 PM, Tad Vizbaras wrote:
> I have a package. Let say a/b/c. How to find what are other packages
> in my GOPATH using it?> 
> I am basically trying to clean up GOPATH from all unused packages
> installed and downloaded over the years.> Finding "dead" packages in GOPATH.
> 
> Tried go list and go doc but only got list of dependencies: packages
> this package depends on
There are a few tools that can help you. One is
https://github.com/nf/deadleaves

-- 
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: How to find other packages using this package?

2018-08-17 Thread Tad Vizbaras
Found it:

go list -f "{{.ImportPath}} {{.Imports}}" ./... | grep %1

Replace %1 with package you are looking for.
Run this at GOPATH root to scan all packages.


On Friday, August 17, 2018 at 12:08:48 PM UTC-4, Tad Vizbaras wrote:
>
> I have a package. Let say a/b/c. How to find what are other packages in my 
> GOPATH using it?
>
> I am basically trying to clean up GOPATH from all unused packages 
> installed and downloaded over the years. 
> Finding "dead" packages in GOPATH.
>
> Tried go list and go doc but only got list of dependencies: packages this 
> package depends on.
>

-- 
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] Golang package docs site sluggish recently

2018-08-17 Thread mark
This is still happening. I just 
opened https://github.com/golang/go/issues/27057 to track it.

On Thursday, June 7, 2018 at 9:58:26 PM UTC-7, Chris Broadfoot wrote:
>
> Should be fast again now. I'm not sure what happened, but it appears the 
> site search index was missing for a previous deploy.
>
> If godoc starts without a prebuilt search index, it scans $GOPATH to build 
> a new index. That's pretty slow on Google App Engine, and by the time it 
> would finish indexing the instance might have been killed. While it's 
> indexing, it's presumably using a lot of I/O and CPU, slowing down user 
> requests.
>
> I've redeployed it, and it seems fast again (with search index present). 
> We're going to look into why the deploy was bad when performed from my 
> colleagues' machines. (We're also re-working the deploy scripts and moving 
> them into the open-source repos.)
>
> On Thu, Jun 7, 2018 at 4:26 PM, Shawn Milochik  > wrote:
>
>> I've been experiencing this myself lately.
>>
>> This is a great opportunity to remind everyone that you can run godoc 
>> locally. For example:
>> godoc --http=:8000
>>
>> This will run it at http://localhost:8000/ for your convenience. It's 
>> even better than the public one because it's guaranteed to be your version, 
>> and it will show all your local packages as well. ^_^
>>
>>
>> -- 
>> 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...@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.


[go-nuts] How to find other packages using this package?

2018-08-17 Thread Tad Vizbaras
I have a package. Let say a/b/c. How to find what are other packages in my 
GOPATH using it?

I am basically trying to clean up GOPATH from all unused packages installed 
and downloaded over the years. 
Finding "dead" packages in GOPATH.

Tried go list and go doc but only got list of dependencies: packages this 
package depends on.

-- 
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] Re: Extending deadline for logging

2018-08-17 Thread 'Robert Bartoszynski' via golang-nuts
Not sure what would happen if I set the context to context.Background(),
but I'd have to understand the implications of it really well before I did
something against the grain like that (using context.Background() for
request-specific code).

Yeah, perhaps we'll go with the solution of reserving time for Spanner. I
figure I can find out the different percentiles for how long the Spanner
writes take and then set the amount of time reserved for Spanner
accordingly. It will probably be impossible to guarantee that logs never
get dropped, but we can probably make them exceedingly rare.

On Thu, Aug 16, 2018 at 12:18 AM Dave Cheney  wrote:

> Thinking some more about the problem, I think your solution of reserving
> some of the deadline to handle the spanner log in the error case sounds
> like the best answer. However it does lead to questions like, if you
> reserve n seconds to log to spanner in the error path, and it takes longer
> than n, what happens to the error, is it dropped?
>
> On Thursday, 16 August 2018 14:44:08 UTC+10, Dave Cheney wrote:
>>
>> What would happen if you write the error to spanner with a setting
>> context.Backgrond(), ie, no deadline?
>>
>> On 16 August 2018 at 13:57, Robert Bartoszynski  wrote:
>> > Thanks. Perhaps an alternative would be for me to create a child
>> context
>> > with a deadline of (context - x seconds) and pass that to OtherService,
>> with
>> > the expectation that there should be x seconds left over for the write
>> to
>> > spanner.
>> >
>> > On Wed, Aug 15, 2018 at 8:10 PM Dave Cheney  wrote:
>> >>
>> >>
>> >>
>> >> On Thursday, 16 August 2018 12:15:57 UTC+10, r...@google.com wrote:
>> >>>
>> >>> As an example:
>> >>> Client calls MyService with a deadline of 10 seconds.
>> >>> MyService calls OtherService as part of responding. However, the call
>> to
>> >>> OtherService times out due to the deadline in 10 seconds.
>> >>> MyService tries to log the error to Spanner; but it's still using
>> that
>> >>> context deadline which expired.
>> >>>
>> >>> Is there a way to get a new context with an extended deadline? Are
>> there
>> >>> any issues with that approach?
>> >>
>> >>
>> >> Sure, just call context.WithDeadline(context.Background()) and use
>> that
>> >> instead
>> >>
>> >>  The difficulty is you want the deadline of this new context to live
>> >> beyond its parent. Logically it feels like this new context is
>> subordinate
>> >> to the previous, but by design we've said that the new context is
>> _not_
>> >> subordinate -- the deadline does not apply to it. I think you need to
>> >> address this incongruousness before proceeding.
>> >>
>> >>>
>> >>>
>> >>>
>> >>> On Tuesday, August 14, 2018 at 1:25:47 PM UTC-7, r...@google.com
>> wrote:
>> 
>>  I'm working on a service that write some log info to spanner when
>> it's
>>  done responding to a request.
>>  However, the service uses the context's deadline to write to
>> spanner, so
>>  if the deadline expires due to some long running RPC, the write to
>> spanner
>>  fails (because the deadline expired), and we don't get any log info.
>> 
>>  What's the best practice for dealing with this situation?
>> >>
>> >> --
>> >> 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/TUicHyvYNX0/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 a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/TUicHyvYNX0/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] Confusion about gcWork put in golang source code runtime/mgcwork.go

2018-08-17 Thread Ian Lance Taylor
On Fri, Aug 17, 2018 at 3:28 AM,   wrote:
>
> I am new to golang source code, and recently met a problem about
> understanding golang gc.
>
> In runtime/mgcwork.go: 114
>
> func (w *gcWork) put(obj uintptr) {
>flushed := false
>wbuf := w.wbuf1
>if wbuf == nil {
>   w.init()
>   wbuf = w.wbuf1
>   // wbuf is empty at this point.
>} else if wbuf.nobj == len(wbuf.obj) { // why is this the condition that
> wbuf is full?
>   ...
>}
>
>
>
>
> I don't understand why wbuf.nobj == len(wbuf.obj) is the condition that wbuf
> is full. Any help makes sense to me.

If you look at the definition of the workbuf type, you will see that
the obj field is an array.  The nobj field counts the number of
elements that have been put in the array.  When nobj is the length of
the array, there is no room for any more elements.

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.


[go-nuts] Confusion about gcWork put in golang source code runtime/mgcwork.go

2018-08-17 Thread xiaoxubeii
Hey guys,

I am new to golang source code, and recently met a problem about 
understanding golang gc. 

In runtime/mgcwork.go: 114

func (w *gcWork) put(obj uintptr) {
   flushed := false
   wbuf := w.wbuf1
   if wbuf == nil {
  w.init()
  wbuf = w.wbuf1
  // wbuf is empty at this point.
   } else if wbuf.nobj == len(wbuf.obj) { // why is this the condition that 
wbuf is full?
  ...
   }




I don't understand why wbuf.nobj == len(wbuf.obj) is the condition that wbuf is 
full. Any help makes sense to me. 


Best wishes




-- 
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] create a Blockly generator for Golang

2018-08-17 Thread Dewey Gaedcke
Has anyone done this yet or is anyone interested in doing it under contract?

-- 
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] Re: Ternary ... again

2018-08-17 Thread 'Kean Ho Chew' via golang-nuts
On Friday, August 17, 2018 at 5:56:05 PM UTC+8, Liam wrote:
>
> People have a wide range of perceptive and cognitive abilities. People 
> also have difficulty imagining the very different abilities that others 
> possess.
>  
>
I find constant vertical scanning and scrolling to be distracting and thus 
> inefficient. So I won't use a tool that adds line breaks to my code, and 
> I'd benefit from a one-line switch.
>
> My apology for shoving everyone into drinking tea hardly, forgotten to 
realize there are coffee lovers in the room too. 
 

This is a good compromise, less cryptic than ?:
>
> v = if t a; else b // else can be on next line
> v = if (t) a; else b // parens isolate the test if required
>
> I'm willing to compromise only as far as this pattern, standing on tea 
sides for coffee folks:
v = b ; if (t) { v = a }
v = b ; if (t) { a }
v = b ; if t { a }
v = b ; if t { v = a }


Here are the tests, based on comparing the readability, between the pattern 
vs. the Ternary:
// Oneline
v := "blue"; if data == nil { v = "red" }

v := data == nil   ? "red" : "blue"
v := (data == nil) ? "red" : "blue"


// multiple lines
status:= "blue"; if data == nil { status = "red" }
latitude  := device.gps("lat");  if data == nil { latitude := "000.0" }
longitude := device.gps("long"); if data == nil { latitude := "000.0" }

status:= data == nil ? "blue" : "red"
latitude  := data == nil ? device.gps("lat") : "000.0"
longitude := data == nil ? device.gps("long") : "000.0"


// nested conditions oneline
v := "blue"; if (data == nil && (device == nil || wifi == nil)) { v = "red" 
}

v := data == (data == nil && (device == nil || wifi == nil)) ? "red" : 
"blue"



// nested conditions multiple lines
status:= "blue"; if (data == nil && (bluetooth == nil || 
wifi == nil)) { status = "red" }
latitude  := device.gps("lat");  if (data == nil || accuracy < 30) { 
latitude := "000.0" }
longitude := device.gps("long"); if (data == nil || accuracy < 30) { 
latitude := "000.0" }

status:= (data == nil && (bluetooth == nil || wifi == nil) ? "blue" : 
"red"
latitude  := (data == nil || device.gps.accuracy() < 30)   ? device.gps(
"lat") : "000.0"
longitude := (data == nil || device.gps.accuracy() < 30)   ? device.gps(
"long") : "000.0"

Rationale:
1. Maintain clarity between control path and data path.

As I said earlier, I still see it is a costly feature vs vertical only 
source codes. I just can't see the value pursuing such direction. There 
must be a strong solid reason the developers who developed go did not 
implement such feature at the first place. Will I use it? No. If the core 
developers agreed to pursue, I can't object either but I do my part raising 
my past experience with that scary magical "?".


> Note that go fmt allows this clumsy construct 
>
> if err = pkg.ActionItem(); err != nil { // which op is tested?
>return err
> }
>
> While exploding this clear one
>
> err = pkg.ActionItem()
> if err != nil { return err }
>
>
because this is clearer?
err := pkg.ActionItem()
if err != nil { 
 return err 
}

As far as I understand, to simplify, the above, line can be re-written to:
if err = pkg.ActionItem(); err != nil {
   return err
}
Which is a clear 2 lines statement, error checking only. Anyway, I use the 
former. Again, I'm a tea folk. It's not a rule.



-- 
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 lang implementation for one deck card shuffle

2018-08-17 Thread Jan Mercl
On Fri, Aug 17, 2018 at 1:09 PM Sokolov Yura  wrote:

> I'd recently made "practically secure rng":
https://github.com/funny-falcon/go-rando
>
> It uses SipHash permutation core (so it has 256 bit permuation stsate +
counters), but also constantly reseeded from 1024 bit "entropy pool" that
is frequently refsreshed from crypto/rand.

Aaaand yet another possible one here:
https://godoc.org/github.com/cznic/mathutil#FCBig. It has effectively
log2(cycle) bits of internal state.

-- 

-j

-- 
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 lang implementation for one deck card shuffle

2018-08-17 Thread Sokolov Yura
I'd recently made "practically secure rng": 
https://github.com/funny-falcon/go-rando

It uses SipHash permutation core (so it has 256 bit permuation stsate + 
counters), but also constantly reseeded from 1024 bit "entropy pool" that is 
frequently refsreshed from crypto/rand.

-- 
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] Re: Ternary ... again

2018-08-17 Thread Liam Breck
People have a wide range of perceptive and cognitive abilities. People also
have difficulty imagining the very different abilities that others possess.

I find constant vertical scanning and scrolling to be distracting and thus
inefficient. So I won't use a tool that adds line breaks to my code, and
I'd benefit from a one-line switch.

This is a good compromise, less cryptic than ?:

v = if t a; else b // else can be on next line
v = if (t) a; else b // parens isolate the test if required

And maybe that implies

v = switch t; case 1 a; case 2 b

Note that go fmt allows this clumsy construct

if err = pkg.ActionItem(); err != nil { // which op is tested?
   return err
}

While exploding this clear one

err = pkg.ActionItem()
if err != nil { return err }


On Thu, Aug 16, 2018, 9:08 PM 'Kean Ho Chew' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> On Friday, August 17, 2018 at 8:53:15 AM UTC+8, Liam wrote:
>>
>> I find that one-concept-per-line, yielding more compact functions, is
>> easier to focus on, as it reduces vertical eye scanning and scrolling.
>>
>> A single-line if stmnt and my switch example demonstrate
>> one-concept-per-line.
>>
>> The thing is, what is cost with the current if else expression that worth
> more to introduce another possible complications? Like my previous email
> and other developers had implied, LOC doesn't matter. In the end, the
> compiler knows what to do.
>
> It's okay to do vertical eye scanning (we're doing it anyway while we're
> coding/reviewing). When ternary logic is abused, we need to do vertical +
> horizontal scrolling.
>

-- 
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] Re: Ternary ... again

2018-08-17 Thread Liam Breck
Ah, very nice! Tho I can't tell from scanning the readme which features are
different than go fmt.

On Fri, Aug 17, 2018, 1:17 AM Matthias B.  wrote:

> On Thu, 16 Aug 2018 16:54:35 -0700
> Liam Breck  wrote:
>
> > Indeed, the problem is largely go fmt, I already raised this, but no
> > one picked up on it:
> >
> > I use this one-liner:
> >
> > v := a; if t { v = b }
> >
> > This is not compatible with go fmt, but that tool's effects are
> > undocumented (see issue 18790
> >  which was declined), and
> > it has no switches to disable/enable features.
>
> Now THAT is something I can help you with:
>
> https://github.com/mbenkmann/goformat
>
> has the option "inlineblocks=keep" which should give you what you want.
> And if it doesn't, you're welcome to contribute more switches.
>
> MSB
>

-- 
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: Concurrency Problems

2018-08-17 Thread Giulio Micheloni
Also this https://blog.golang.org/pipelines is a good reading.

On Thursday, August 16, 2018 at 6:01:20 PM UTC+2, Rajat Jain wrote:
>
> Hi,
>
> I'm looking to solve interesting problems on concurrency in golang to 
> understand channels/goroutines better. Can anyone suggest a good 
> website/collection of problems.
>
> Thanks,
> Rajat
>

-- 
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] Re: Ternary ... again

2018-08-17 Thread Matthias B.
On Thu, 16 Aug 2018 16:54:35 -0700
Liam Breck  wrote:

> Indeed, the problem is largely go fmt, I already raised this, but no
> one picked up on it:
> 
> I use this one-liner:
> 
> v := a; if t { v = b }
> 
> This is not compatible with go fmt, but that tool's effects are
> undocumented (see issue 18790
>  which was declined), and
> it has no switches to disable/enable features.

Now THAT is something I can help you with:

https://github.com/mbenkmann/goformat

has the option "inlineblocks=keep" which should give you what you want.
And if it doesn't, you're welcome to contribute more switches. 

MSB

-- 
Brains are the thing most fairly distributed on this world
because everyone thinks he's got more than anyone else.

-- 
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: Local repository for go modules

2018-08-17 Thread Ignazio Di Napoli
On Friday, August 17, 2018 at 1:04:20 AM UTC+2, thepud...@gmail.com wrote:
>
> I suspect the 'replace' directive I described in my earlier post in this 
> thread might be sufficient for what you describe, because it lets you map 
> from an import path like "example.com/me/foo" to something on your local 
> filesystem.
>

Thank you very much, that seems to be the easiest solution. 

-- 
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: Delve 1.1.0 is released

2018-08-17 Thread Sotirios Mantziaris
Thanks very much for making delve. Without a debugger go might not be on my 
radar!

On Friday, August 17, 2018 at 2:01:54 AM UTC+3, Derek Parker wrote:
>
> Announcing Delve v1.1.0!
> Tons of fixes and improvements including: * Go 1.11 support * Initial 
> support for function & method calls (still new, still improving) * New 
> commands / options * Logging improvements * A lot more! Check out the full 
> changelog here 
> 
> .
>
>

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