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 closing a closed channel cau
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 announ
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 unsubscri
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 unsub
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
> > to recreate the Unix 'ls' command
Thanks!
On Thursday, November 2, 2017 at 6:49:43 PM UTC-2, Shawn Milochik wrote:
>
> 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 g
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 offers.
>
> Here's
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 golang-nuts+unsubscr...@googlegroups.c
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() {
dop
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
> request.
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.
>
> github.com/
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 i
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 := net.ListenTCP("
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
cha
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 than once.
>
> Andy
>
>
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 nu
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 creat
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
Go 1.10 will not use timestamps, but content to determine staleness.
--
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
On Thu, Nov 2, 2017 at 6:54 AM sheepbao wrote:
> the close function is thread safety? how about call `closed` at the same
time.
I don't know, but you might want to reconsider posting text with contrast
going in some places below 10% (guestimated), to possibly get answers from
people which refuse
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 prefe
who can solve this problem?
在 2017年10月30日星期一 UTC+8下午2:55:27,28911...@gmail.com写道:
>
> 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,
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 1, 2017 at 12:04:14 AM UTC-7,
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 {
26 matches
Mail list logo