On Thu, Nov 2, 2017 at 4:54 PM, sheepbao wrote:
>
> the close function is thread safety? how about call `closed` at the same
> time.
It's not safe. Multiple goroutines can enter the 'default' case in
that select and close() the channel multiple times.
"Sending to or
That looks really neat. I will dive into the code!
I'm very curious how the performance of Skylark in Go compares to Skylark
in Java (and CPython 3.6 for that matter) -- any benchmarks on that?
-Ben
On Monday, October 2, 2017 at 12:39:43 PM UTC-4, Alan Donovan wrote:
>
> I'm pleased to
You don't even need to do waitgroups if the main() function is the one that
is last in the pipeline: cf
https://leaflessca.wordpress.com/2017/01/04/forwards-and-backwords-pipes-in-go/
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
You don't even mneed to do weaitgroups if the main() function is the one
that is last in the pipeline :
cf
https://leaflessca.wordpress.com/2017/01/04/forwards-and-backwords-pipes-in-go/
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
Thanks, Dave! Using [[override]] fixed the problem
[[override]]
name = "github.com/ugorji/go"
revision = "ded73eae5db7e7a0ef6f55aace87a2873c5d2b74"
That's all I needed.
*dep* seems to have problems resolving the correct transitive dependency
versions at the moment. Hope they get that fixed
Or you use the "standard" unix trick:
go run ls.go -- ls.go
On Thu, Nov 2, 2017 at 1:55 PM, Ian Lance Taylor wrote:
> On Thu, Nov 2, 2017 at 10:37 AM, Jon Forrest wrote:
> >
> > I'm learning Go. Whenever I learn a new programming language I like to
> try
>
On Thu, Nov 2, 2017 at 10:37 AM, Jon Forrest wrote:
>
> I'm learning Go. Whenever I learn a new programming language I like to try
> to recreate the Unix 'ls' command
> in that language. I've found that such an exercise is often a good way to
> get familiar with what a language
Just use Add and a negative duration:
https://play.golang.org/p/ueYLh1nrps
--
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
Hi
Here is the code:
Version 1:
package main
import (
"fmt"
"sync"
)
var a string
var once sync.Once
func setup() {
a = "hello,world\n"
}
func doprint() {
once.Do(setup)
fmt.Print(a)
}
func twoprint() <-chan struct{} {
var wg sync.WaitGroup
wg.Add(2)
ch := make(chan struct{})
go func() {
Hi there, how are you doing?
I'd like to get a time.Time 1h hour in the past. I see in the documentation
that Go has a time.Add functions, it would be something like this, but for
subtraction.
The time.Sub function returns a Duration type, and I need a Time type.
Thanks!
--
You received this
ctx, cancel = context.WithTimeout(context.Background(), client.Timeout)
On Tuesday, October 31, 2017 at 5:52:29 AM UTC-7, 慕希颜 wrote:
>
> Is there a way to add a timeout setting for per request if i declare a
> global var? Because in my case i need different timeout setting for per
>
This looks neat. Are you able to provide more context on what this is/will
be used for at Google?
On Monday, October 2, 2017 at 12:39:43 PM UTC-4, Alan Donovan wrote:
>
> I'm pleased to announce the launch of Skylark in Go: an interpreter for
> Skylark, implemented in Go.
>
>
The latest release brings a big update for the IDE:
- final name changed from the (initial) codename to GoLand
- Go templates are now supported with more improvements to be done in the
future
- pricing information and general availability target date are also
announced
Please give it a try and
On Mon, Oct 30, 2017, 7:55 PM <2891132l...@gmail.com> wrote:
> I write this code in the follwings:
> package main
>
> import (
> "fmt"
> "net"
> "os"
> )
>
> func main() {
> service := ":5000"
> tcpAddr, err := net.ResolveTCPAddr("tcp", service)
> checkError(err)
> listener, err :=
You absolutely can use goroutines without waitgroups! It all depends on
what you are doing with them. Where waitgroups come in is when you need to
something only after *all* of the goroutines on a specific task are done.
Chances are that if you are not using waitgroups, you are either using
And technically they are not tracking goroutines but done things. Each
goroutine could each finish 10 things.
On Thu, 2 Nov 2017, 17:01 Andy Balholm, wrote:
> You can add goroutines to a WaitGroup as you create them. There is nothing
> that keeps you from calling Add more
You can add goroutines to a WaitGroup as you create them. There is nothing that
keeps you from calling Add more than once.
Andy
> On Nov 1, 2017, at 11:10 PM, kanth...@gmail.com wrote:
>
> I am new to Go and I had read numerous times in various articles that one can
> technically create any
I am new to Go and I had read numerous times in various articles that one
can technically create any number of Go routines and the runtime takes care
of them mapping to kernel threads. If so, why does waitGroup designed in a
way such that one has to specify how many go routines one need to
Hi, all. liteide x33 released!
This version optimizes the editor function, reads the file support codec
automatically detects, reloads the file using diff way to optimize,
re-implements the Mark API and adds new Bookmarks plugin. Go classview and
outline adds TodoList display. Fixes GolangEdit
Sorry,I try my best to open the website but it can't work.Can you write it
??Thank you so much.
在 2017年10月30日星期一 UTC+8下午4:29:44,snmed写道:
>
> Hi
>
> There are several ways to solve it, here are two of them:
>
> https://play.golang.org/p/wJwkI7HQwv
> https://play.golang.org/p/nasUcgBeG4
>
> I
Thanks.
2017-11-02 10:06 GMT+05:30 Chris Broadfoot :
> You can use a main package.
>
> package main
>
> import (
>"net/http"
>"google.golang.org/appengine"
> )
>
> func main() {
>http.HandleFunc(...)
>appengine.Main()
> }
>
>
> On Wednesday, November
On Wednesday, 1 November 2017 12:19:19 UTC+1, JuciÊ Andrade wrote:
>
> Ayan, imagine I am part of a development team. In our program I have a
> pointer r:
>
> r *myType
>
> My variable r can be nil, because that is a valid situation. It is used in
> dozens of places, like this:
>
> if r != nil {
22 matches
Mail list logo