Hi, you want to use append, not copy:
https://play.golang.org/p/1TXCsC4-GJ
On Sunday, October 2, 2016 at 5:18:42 PM UTC+3, 高橋誠二 wrote:
>
> As official doc explains, copy to zero length slice results to be empty.
>
> package main
>
> import "fmt"
>
> func main() {
> src := []int{1, 2, 3}
>
Hello,
A few months ago, I announced [0] a service for managing Go import paths
for custom domains gopherpit.com. It was made for personal needs for
private and commercial projects that are not hosted on github. The source
code and binary releases are now available on GitHub [1], as well as
* Matt Harden [161001 23:34]:
> I do think that T L has a point. The spec defines the syntax of the
> language, and TypeSpec refers to a syntactical construct. It is not
> possible in the syntax of the language to create two named types that
> originate in the same
One thing you can try is to increase the number of locks so that the
goroutines aren't all stopped on a single lock. For example you can
partition your stores: https://play.golang.org/p/y16yr57KcQ
type PartitionedStore struct {
stores []Store
}
func NewPartitionedStore(sz int)
package main
import (
"fmt"
)
func main() {
a := interface{}(100)
println(, a)
fmt.Sprint(a)
}
go run x.go the output:
0xc42003bf18 (0x89040,0xc42000a2c0)
I just want to ask 0xc42000a2c0 as the a (interface{}) 's data pointer is
point to where ? heap ?
also I test this:
No, it should not operate that way.
Remember that all function calls in Go pass arguments by value. A slice is
actually a value somewhat analogous to
type SliceOfT struct {
Data*T
Len int
Cap int
}
When
-gcflags="-m -m" will make the compiler print out its escape analysis
choices. This might be easier than instrumenting your code, which might
affect the escape analysis decisions.
On Monday, 3 October 2016 13:48:47 UTC+11, 刘桂祥 wrote:
>
> Yes you are right . thanks a lot and I try more debug
You seemingly use both a vendored version of go-kit and a non-vendored
version (likely you are importing something from outside of vendor/ which
imports go-kit itself) and are trying to use a Counter from the vendored
version in the unvendored version. As the two are different packages, the
Ok, in fact, this is really a problem about how to comprehend the words in
go spec.
There are two different interpretations of the words for the following two
questions,
1. what does "the same type-spec" mean?
2. what does "two named types" mean?
Your interpretations:
1. "the same type-spec"
fmt.* functions may call Stringer and Formatter interface methods for the
passed arguments, so the arguments may escape when calling these methods.
Probably, conditional escaping may be implemented for function argument. For
example of fmt.*, escape only arguments implementing Stringer or
my main.go is
in https://github.com/dharesh007/challenge2016/tree/master/cmd/locationService
folder and vender dir is in it. where should I put vendor dir.
On Sunday, 2 October 2016 14:47:53 UTC+5:30, Axel Wagner wrote:
>
> That repository contains no vendor/ folder.
>
> On Sun, Oct 2, 2016 at
Hi Chris:
I am gopher from Beijing China . I am very like programing and adore
the old hack culture . and NBA too!
I am very happy in google groups and receive the answer so quickly.
go on practice programing and improve my badly english
That repository contains no vendor/ folder.
On Sun, Oct 2, 2016 at 9:49 AM, wrote:
> I am using vendor version only
>
> On Sunday, 2 October 2016 12:40:28 UTC+5:30, Axel Wagner wrote:
>>
>> You seemingly use both a vendored version of go-kit and a non-vendored
>>
Why there is no field initializer in Go? Like:
type gate struct {
outgoing = make(chan *sendRequest)
incoming = make(chan update, 10)
}
Doesn't that make zero value more useful? The syntax already exists for
global variables so IMHO not much new would get introduced to the language
Got It. Vendor folder should be at root of repo. thanks.
On Sunday, 2 October 2016 09:37:06 UTC+5:30, topiya...@gmail.com wrote:
>
> I have two import packages and have it in vendor dir.
>
> kitprometheus "github.com/go-kit/kit/metrics/prometheus"
>
> stdprometheus
On Sat, Oct 1, 2016 at 4:21 PM, wrote:
>
> What applications can be build package OS ???
>
> if u can say example i be very happy
>
> thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from
So, I don't really get what's the problem here, tbh. The spec seams
perfectly fine as it is right now to me.
* If two named types come from different type-specs, they are not treated
as identical. We covered how that can happen.
* If two named types come from the same type-spec, then they are
https://github.com/dharesh007/challenge2016
I think it's related to package alias.
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/metrics"
works fine.
but
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
stdprometheus
I am using vendor version only
On Sunday, 2 October 2016 12:40:28 UTC+5:30, Axel Wagner wrote:
>
> You seemingly use both a vendored version of go-kit and a non-vendored
> version (likely you are importing something from outside of vendor/ which
> imports go-kit itself) and are trying to use a
On Sat, Oct 1, 2016 at 6:45 PM, Ian Lance Taylor wrote:
> There are improvements to the compiler's escape analysis in every release.
Also, escape/representation analysis is approximate in nature. So you can't
easily detect all variants of this and have the compiler optimize
You are right. But this felt clean and obvious syntax. Back to NewGate!
On Sunday, October 2, 2016 at 1:47:27 PM UTC+3:30, Axel Wagner wrote:
>
> Because that wouldn't be "the zero value" anymore.
> It would require that, when you do e.g.
> x := make([]gate, 4096)
> that the compiler emits the
Hi,
I've written a small library (https://github.com/toefel18/go-patan) in that
stores counters and collects statistics (running
min/max/average/stddeviation) of a program during runtime. There is a lock
based implementation and a channel based implementation. I've written this
library before
>From what I understood, MIPS32 support for Golang has been in the pipeline
for some time already so it might appear at some point. MIPS64 is there
since 1.6 and fully supported in 1.7.
Sadly, very few OpenWRT hardware uses MIPS64, only the higher grade
products do.
You will have to use gccgo
Hi all,
I'm making a binding of a C++ library for go, and I'm wondering why the
anonymous field inheritance isn't used in the go wrapper code.
I have found a piece of comment in the go backend of SWIG, saying:
// For each method defined in a base class but not defined in
> // this
As official doc explains, copy to zero length slice results to be empty.
package main
import "fmt"
func main() {
src := []int{1, 2, 3}
dst := []int{}
fmt.Println(len(dst))
copy(dst, src)
fmt.Println(src)
fmt.Println(dst)
// [1 2 3]
// []
src2 := []int{1, 2,
25 matches
Mail list logo