On Wed, Apr 18, 2018 at 2:35 PM Federico Paolinelli
wrote:
See https://golang.org/pkg/testing/#hdr-Examples. Put the examples into the
foo_test.go file.
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Wed, Apr 18, 2018 at 1:24 PM Ali Altun wrote:
> There is a code part in the https://golang.org/pkg/sort/#example_
> The Go code formatter doesn't change this code.
The code is already gofmt'ed, so no change is expected.
> Similarly, how can I make it leave the
On Fri, Apr 13, 2018 at 2:29 PM wrote:
> What i do wrong?
The code relies on the bool value in 'ok', returned from .Load(), but that
_does not_ mean some other goroutine, once you remove the mutex.Lock(),
cannot insert a value for the same key the moment the call of
On Wed, Apr 11, 2018 at 3:21 PM Robert P. J. Day
wrote:
> ... -- what does it mean
> to import a name that is a single .a file versus importing a directory
> name from under GOROOT (in my case, on fedora, /usr/lib/golang).
You mostly cannot really import a file and
On Wed, Apr 11, 2018 at 2:50 PM Reed Wade wrote:
> Is there a sensible existing way to do that? Would this be a useful
update to the lib?
Not very nice, but: https://play.golang.org/p/gkWEuV1AlwB
--
-j
--
You received this message because you are subscribed to the
On Tue, Apr 10, 2018 at 8:29 PM Sankar wrote:
> Any help on how I can get arr sorted in the above code ?
Just a typo: https://play.golang.org/p/vhbo8OIrh-H
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
On Tue, Apr 10, 2018 at 1:32 AM Alex Dvoretskiy
wrote:
> Why there is no difference if the last comma exists?
Because the language specification allows to omit the last comma before the
closing '}':
LiteralValue = "{" [ ElementList [ "," ] ] "}" .
See:
On Mon, Apr 9, 2018 at 4:37 PM Alex Efros wrote:
> I've just tried it with strings.Reader and found current seek position
> after FindReaderSubmatchIndex is in 3 bytes after end of the match:
> https://play.golang.org/p/OJT7Ri8ji2C
Maybe
On Mon, Apr 9, 2018 at 6:47 AM Paul Lalonde
wrote:
> Any advice?
If regexp cannot solve your task don't use regexp. Write the tiny state
machine by yourself, it should be not too much code.
--
-j
--
You received this message because you are subscribed to the
On Thu, Apr 5, 2018 at 9:10 AM T L wrote:
> yes. it is a resource leak.
It's not necessarily a leak. It's a possible leak.
And digging even deeper: it's implementation defined. Non-reachable
channels can be collected and goroutines blocked on them killed without
changing
On Wed, Mar 28, 2018 at 1:20 PM ToSuNuS wrote:
> Is there a way to write this more smoothly, or is there no problem with
the function?
Hard to tell. What you've posted seems to not conform to the Go grammar.
Please try to share the snippet using the Go playground (
On Thu, Mar 22, 2018 at 4:46 PM wrote:
> Can I assume that the code above will never panic?
Yes:
If one or more of the communications can proceed, a single one that can
proceed is chosen via a uniform pseudo-random selection. Otherwise, if
there is a default case, that
On Tue, Mar 20, 2018 at 6:48 PM Ian Lance Taylor wrote:
> In this case I don't agree. The order of evaluation rules make it
> clear that the first output is 1 and the last output is 2, but they do
> not specify when the value of y is read.
I see, I missed the "... and the
On Tue, Mar 20, 2018 at 6:19 PM T L wrote:
> Yes "1 1 2" is the output of gc, but I can't find any guarantees made for
this output in Go specification.
The guarantee was mentioned: LTR evaluation order as seen in the specs
here:
On Tue, Mar 20, 2018 at 5:18 PM T L wrote:
> For the following example, the output may be any of "1 7 2", "1 8 2" and
"1 9 2"?
The output is "1 1 2" due to LTR evaluation order mandated by the specs:
https://play.golang.org/p/WorzfBzfOhe
--
-j
--
You received this
On Mon, Mar 19, 2018 at 1:24 AM Vitor De Mario
wrote:
> It is a public document, open to any comments and edits.
Such documents tend to not live for long.
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Sun, Mar 18, 2018 at 6:21 PM Devon H. O'Dell
wrote:
> * There is no way to force at least 16 byte alignment of data per the
language spec, so there is no way to implement DCAS (notably missing
from sync/atomic) on amd64 (cmpxchg16b requires 16 byte alignment of
its
On Fri, Mar 16, 2018 at 7:40 PM T L wrote:
> I feel the second append call should be also valid.
Works as intended: T is not struct{}
If desired, it can become that: https://play.golang.org/p/nY-BB3t0IAw
--
-j
--
You received this message because you are subscribed
On Thu, Mar 15, 2018 at 3:29 PM T L wrote:
> I mean "always makes 64-bit words 64-bit aligned on i386 OSes."
AFAIK, that's not the case, ie. not always.
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Tue, Mar 13, 2018 at 3:35 PM Sathish VJ wrote:
> Trying to figure out profiling and flame graphs on the latest go. And
information seems to be lacking. Any pointers to articles that work?
https://github.com/uber/go-torch
--
-j
--
You received this message because
On Fri, Mar 9, 2018 at 8:19 AM Andrey Tcherepanov <
xnow4fippy...@sneakemail.com> wrote:
> So if this is a "just" a mutex, this whole thing will not be atomic - it
would introduce intermediate (albeit invisible) between "<-" parts. I was
hoping for the "edge collapse" here.
Not sure IIUC, but I
On Fri, Mar 9, 2018 at 7:47 AM Andrey Tcherepanov <
xnow4fippy...@sneakemail.com> wrote:
> ch <- <-ch // Is this an atomic operation?
Channel send and receive operations are safe wrt to concurrency. That may
be seen atomic in a certain sense: only one goroutine at a time can ever
perform such
On Thu, Mar 8, 2018 at 7:44 PM David Wahlstedt <
david.wahlstedt@gmail.com> wrote:
> So, if golang has been bootstrapped, compiled with itself, how did they
write the parser?
> By hand, or by using an LR parser and tweaking the grammar?
Go authors initially used a modified grammar (distilled
On Mon, Mar 5, 2018 at 1:42 PM wrote:
> .. isn't the EBNF at https://golang.org/ref/spec#Assignments currently
wrong - in that it allows what is currently disallowed
The EBNF is just a part of the specification that defines the grammar.
Other parts of the specification
On Mon, Mar 5, 2018 at 12:55 AM wrote:
> For my use case, I'll only be checking numbers > 2^18 and < 2^25. After
looking at the repo, it's not simple enough to copy primes.go, anyone that
wants to rely on it would have to fork the repo.
No need to copy source code or
On Sun, Mar 4, 2018 at 9:38 PM wrote:
> The performance looks to be as good or slightly better than my simple
implementation.
FTR, the performance is in an order of magnitude, or as you put it
"slightly", better in the case of uint32 - and probably several orders of
On Sun, Mar 4, 2018 at 7:27 AM wrote:
> It still has room for optimization, but it is much faster than
ProbablyPrime(0) for 32-bit integers.
>
http://nerdralph.blogspot.ca/2018/03/fast-small-prime-checker-in-golang.html
You may want to give the primality checking
On Thu, Mar 1, 2018 at 5:13 PM wrote:
> _ = append(b[1:1], b[:len(b)-1]...)
Bad reading, my fault.
Anyway, I think it should now be clear that append depends on the
'inteligence' of copy as it knows when to move things around from the
beginning and when to start from the
On Thu, Mar 1, 2018 at 4:50 PM wrote:
> copy(a[1:], a) is equivalent to _ = append(s[1:1], s[:len(s)-1]...)
https://play.golang.org/p/uiz2ANSxjbA
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from
On Thu, Mar 1, 2018 at 4:28 PM wrote:
> is the statement right?
It depends on the POV. I see copy as more fundamental than append. It's
easy to write append using copy, not exactly trivial the other way around.
Consider cases like copy(a[], a[1:]) or copy(a[1:], a).
--
-j
On Tue, Feb 27, 2018 at 4:25 PM wrote:
> Why doesn't work this :
Because types []string and []interface{} are different and not assignable
to each other.
> and Why does it work? :
Because type string implements interface{} (as any other type does),
string is assignable to
On Tue, Feb 27, 2018 at 8:17 AM wrote:
> ok, this is really make gophers worry about whether or not the pointer
atomic functions should be used.
What to worry about? Under the Go 1 compatibility promise, the sync/atomic
package is going nowhere, IIUC.
--
-j
--
You
On Sun, Feb 25, 2018 at 3:20 PM wrote:
> I think the unsafe rules allow this.
Yes, but using unsafe provides no guarantees about writable memory.
> I never expect it will crash, for I can't get any information about the
write protection mechanism.
That's not part of the
On Sun, Feb 25, 2018 at 2:29 PM wrote:
> Why does the following program crash?
Because the program attempts to write to the R/O text segment. Why is it
doing that?
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Sun, Feb 25, 2018 at 10:23 AM Bakul Shah wrote:
> Why not case T2?
It does match T2 as well. The order of cases of the type switch maters:
https://play.golang.org/p/nb28xHQP7oU
--
-j
--
You received this message because you are subscribed to the Google Groups
On Tue, Feb 20, 2018 at 9:51 PM wrote:
> But instead the second fmt.Println() output implies that it grabbed more
than one word.
>
> I'm a noob and puzzled by this behavior.
I don't know how the concept of word got involved in the "expected"
behavior, but the code shown has
On Mon, Feb 19, 2018 at 8:35 PM Eric Woroshow
wrote:
> Using uintptr might work, but my concern is that passing a Go pointer
into C by way of a uintptr value might confuse the GC (specifically, that
the memory would fail to be pinned if/when Go implements a moving GC).
On Sun, Feb 18, 2018 at 8:06 PM Bill Wood wrote:
> I thought that the plus operator would return an int, not a myInt.
expr1 + expr2 works iff types of expr1 and expr2 are the same and the
result has the same type as both of the operands. Analogically for the
subtraction,
On Sun, Feb 18, 2018 at 1:06 AM Joseph Lorenzini wrote:
> Is there anyway to force fmt.Print to output the struct fields, even when
it implements the error interface?
What exactly do you mean by "to output the struct fields"?
--
-j
--
You received this message because
On Tue, Feb 13, 2018 at 4:28 PM Ian Lance Taylor wrote:
> I think that will work today but we make no promise that it will
> continue to work in the future. In particular it will fail if the
> garbage collector ever starts to move objects.
Right, I forgot about that and thanks
On Tue, Feb 13, 2018 at 12:40 AM wrote:
> Note though that you can't put pointers to Go heap objects into mmap'd
memory, as the garbage collector can't see them.
It's possible, provided such pointers are known/guaranteed to be reachable
from any memory maintained
On Mon, Feb 12, 2018 at 5:28 PM Juliusz Chroboczek wrote:
> Is it okay to use syscall.Mmap to allocate large amounts of memory, or
> will it conflict with Go's memory allocator?
>From my experience it's ok.
Shameless plug: You might want to have a look at a
On Thu, Feb 8, 2018 at 2:29 PM Mandolyte wrote:
> I want to load it at run time. Is this possible?
Why? The driver code is already linked into your program, otherwise you
would not be able to load it later.
--
-j
--
You received this message because you are subscribed
On Tue, Feb 6, 2018 at 10:31 PM Patrick Smith wrote:
> Obviously I can code around this, but is it a bug that should be
reported?
Not a bug. See https://golang.org/ref/spec#Composite_literals
A parsing ambiguity arises when a composite literal using the TypeName
On Thu, Feb 1, 2018 at 4:26 PM wrote:
> You can also use _ to store unused variables. Like this:
That works, but I do not recommend to do that. The temporary '_= foo'
workaround is too easy to miss and it can stay accidentaly left in
production code. The earlier
On Thu, Feb 1, 2018 at 8:39 AM 王晚成 wrote:
'&' Expression takes the address of an addressable expression.
'&' Type '{' ... '}' creates an instance of T (restrictions apply) and
returns the address of the instance.
--
-j
--
You received this message because you are
On Thu, Feb 1, 2018 at 3:46 AM Alex Buchanan
wrote:
Put this line into any of the package *_test.go files:
func use(...interface{}) {}
When disabling some code in non-test files leads to unused variables foo
and baz error, insert `use(foo, bar)` there to keep
On Mon, Jan 29, 2018 at 12:36 PM pradam
wrote:
> //here its throwing error like: non-boolean condition in if statement
The compiler is right. 'arr' is not a boolean expresion, its type is
'interface{}'. Try: https://play.golang.org/p/zwNV9RD2oCs.
--
-j
--
You
On Tue, Jan 23, 2018 at 5:02 PM Christian LeMoussel
wrote:
> Is it correct /best way ?
Hopefully/only. But as noted previously, not tested.
> There is no memory leaks ?
Something must eventually C.free() the memory allocated by C.CString().
--
-j
--
You received this
On Tue, Jan 23, 2018 at 4:54 PM Christian LeMoussel
wrote:
> devidx := C.scan_bus((*C.char([0])), C.int(cap(sbuf)),
C.CString(sn), C.CString(product))
Not tested: devidx := C.scan_bus((*C.char)(unsafe.Pointer([0])),
C.int(cap(sbuf)), C.CString(sn), C.CString(product))
--
On Tue, Jan 23, 2018 at 4:45 PM dc0d wrote:
> In the sample you have provided, a send syntax is used. And considering
that, (IMHO) f1() must be evaluated first.
Consider f1() is a dispatcher. If it is to be evaluated first then it may
create and return a new channel
On Tue, Jan 23, 2018 at 2:03 PM Chris Hopkins wrote:
> gofmt -w -r 'a.Set(b,c) -> err:=a.Set(b,c)\nif err != nil{log.Fatal("Set
Error",err)}'
I think the -r flag can handle only forms like 'expr1 -> expr2', but in
this case expr2 is a statement. To my surprise I cannot
On Sun, Jan 21, 2018 at 5:54 PM wrote:
> Sounds good to me. I'm not familiar with any performance tradeoffs like
branch prediction changes, but I assume the compiler result is equivalent.
A sufficiently smart compiler can emit zero conditional branches within
CmpX,
On Sun, Jan 21, 2018 at 4:32 PM wrote:
All the else clauses should be dropped.
--
-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
only import a
> single go file when there are multiple go files in a package
> directory?
>
> On Sat, Jan 20, 2018 at 4:32 PM, Jan Mercl <0xj...@gmail.com> wrote:
> > Look for the term "exported" in the language specification.
> >
> > On Sa
Look for the term "exported" in the language specification.
On Sat, Jan 20, 2018, 23:30 Peng Yu wrote:
> Why is only Add allowed? Where is this documented?
>
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Sat, Jan 20, 2018 at 9:29 PM Peng Yu wrote:
s/add/Add/g
--
-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
On Fri, Jan 19, 2018 at 7:48 AM Volker Dobler
wrote:
> Point{1,2} is not a temporary variable but a literal
> and these do have addresses. Just not automatically.
Did you mean {1, 2}? Otherwise Point{1, 2} is a non-addressable value
like 42. Literals do not have
On Thu, Jan 18, 2018 at 7:28 PM Davor Kapša wrote:
> How many members has core team?
>
> How are they internally organised?
> (How are they organised on daily bases? How many sub teams exist and how
are they divided?)
>
> Are they all on Google salaries?
Confidential
On Thu, Jan 18, 2018 at 5:01 PM wrote:
> main_test.go:1:1: illegal character U+0023 '#'
The message says it all. Go is not an interpreted scripting language
supporting #-style comments like bash, Python etc.
--
-j
--
You received this message because you are
On Tue, Jan 16, 2018 at 7:52 AM Lynn H wrote:
> but how about res memory usage? how RES memory used in golang?
Most process allocations typically do not care about the virtual memory
being immediately mapped to physical RAM. The operating systems takes care
about that usually
On Tue, Jan 16, 2018 at 4:49 AM Lynn H wrote:
> not understand ur table,
> when memsize is 256,single channel use 6114Byte memory?
Size of []byte is 3 words, assuming a 64 bit system that's 24 bytes. 256*24
= 6,144 bytes ie. size of a chan []byte with capacity 256, which is
On Mon, Jan 15, 2018 at 6:04 PM Lynn H wrote:
> so what the rules of channel size and memory usage?
Check [0] if the formulas are correct.
[0]:
https://docs.google.com/spreadsheets/d/1BuAnHmBKWfWD9JXXi4_k9ck-rkJyDuQgCQ05s4ytJI8/edit?usp=sharing
--
-j
--
You received
On Sun, Jan 14, 2018 at 5:37 AM wrote:
> I have a parent/child class ...
You don't. No classes, no parents, no children. You need to make your
design work with Go. In most cases you cannot make Go work like languages
supporting classes and inheritance.
--
-j
--
On Wed, Jan 10, 2018 at 2:29 PM pradam wrote:
> I am a newbie to golang, I have been working on this snippet for a while
whenever i run this snippet I am getting above error message.
> I am actual searched on google but i didn't get any proper solution with
an
On Tue, Jan 9, 2018 at 10:08 PM Jim Bishopp wrote:
> Has there ever been a discussion about allowing new identifiers and
selectors in short variable declarations?
FTR: There are other things that are legal on the LHS of an assignment, but
not in the short variable
On Tue, Jan 9, 2018 at 2:18 PM evan wrote:
> i have a 64bit windows 10 development machine. some of the machines in
our production environment are still 32bit windows 8.x and 7.x machines.
>
> would it be possible for me to create exe's for those 32 bit machines
from my
On Sun, Jan 7, 2018 at 11:57 AM T L wrote:
Yes. The choice is to raise a runtime error or not. When not, the value
does not really matter because every value of an integer variable
represents an integer number and there is no combination of the bits left
unused for NaN, Inf,
On Sat, Jan 6, 2018, 11:16 wrote:
> Thanks for your advice! I got the error message and the pstack result
> screenshot from one of our client. I will try to use some OCR tools to
> convert the image to text next time.
>
It's already text, no need for OCR. Just copy the
On Thu, Jan 4, 2018 at 7:08 PM Frank Davidson wrote:
> I'm sure this has probably been answered before, but I have a question
about when a slice's underlying array is copied? In this code:
In your code the underlying arrays are never copied when passed around.
--
-j
On Mon, Jan 1, 2018 at 8:37 PM Kshitij Saraogi
wrote:
> While running the test suite in the "sort" pacakge, I found that all the
examples are not being evaluated.
> I tried running `$ go test -v src/sort` from the base directory of the
repository.
>
> The tests such as
On Sun, Dec 31, 2017 at 4:41 PM dc0d wrote:
> Or the (not only) other option is check for nil channels before entering
the scope of select?
That would remove an equally important property that the RHS can se the
channel to nil.
tl;dr: The current design was
On Sun, Dec 31, 2017 at 1:15 PM dc0d wrote:
> Also the function first() may block on it's own.
That's the very purpose of the select statement!
1. Determine which cases can proceed and which cannot.
2. Randomly select one case which can proceed and perform the
On Sun, Dec 31, 2017 at 12:48 PM dc0d wrote:
> Indeed everything works according to the specs. That is what is being
questioned (the specs).
Well, questioning the specification and expecting unspecified behavior
seems like two different things.
> This behavior for
On Sun, Dec 31, 2017 at 11:55 AM dc0d wrote:
> Please read the first message in this thread. The first() function was
expected to be ignored as in common sense, yet it gets evaluated.
>
> I am not wrong (or right), only making a point (maybe the point seems
pointless)
On Sun, Dec 31, 2017 at 11:47 AM wrote:
> But would it make more sense to throw an error in this case? Is there any
missing points for an un-used private global variable?
I think it's just heuristic. Unused local variable really is an error more
often than an unused TLD
On Fri, Dec 29, 2017 at 10:45 AM Viacheslav Biriukov
wrote:
> I expect that my alignment write from an array will work as it works with
a slice.
The code nowhere cares to make the alignment required by O_DIRECT proper
for the write. It works in one of the cases just by
On Mon, Dec 25, 2017 at 10:11 AM Vasiliy Tolstov
wrote:
What about a write ahead log? https://godoc.org/github.com/cznic/file#WAL
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and
On Sun, Dec 24, 2017 at 10:53 PM Sofiane Cherchalli
wrote:
> Any hints on how to pass test?
>
> https://play.golang.org/p/ucDdBN_jzw7
I have no idea what should be the outcome, just fixed the syntax error:
https://play.golang.org/p/CzRn0QwUayw
--
-j
--
You received
> On Sun, Dec 24, 2017 at 12:31 AM Mariusz Gronczewski
wrote:
> Because other languages do not force you to have name of the package be
derivative of the repo name.
Neither does Go. The whole tool chain uses the name in the package clause,
the import path is used solely to
Putting anything that has a type in any interface makes it non nil.
(*foo)(nil) has a type.
On Fri, Dec 22, 2017, 17:38 Vincent Rischmann wrote:
> Hello,
>
> while refactoring some code I encountered something strange regarding
> redeclarations.
>
> Here is an example:
On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> Pointers that point from a Go object to somewhere outside the Go heap are
perfectly fine.
Can you please specify the exact mechanism used by the runtime to determine
"is outside the Go
On Tue, Dec 19, 2017 at 1:50 PM Xuanyi Chew wrote:
> As such I have no idea what would happen if the GC scanner hits a
unsafe.Pointer that it cannot access. Will the pointer be marked as
unaccessible? Does it panic with SIGBUS?
I think the GC will not try to dereference a
On Tue, Dec 19, 2017 at 12:05 PM Chris Hopkins wrote:
...
> was slower than:
...
Without more information the conclusion that the optimization is not there
cannot be established. Inspect the real produced machine code. I guess
you'll find that the machine code differs in
On Thu, Dec 14, 2017 at 5:05 PM Ivan Borshukov wrote:
> I've noticed that I'm able to edit the wiki pages on
https://github.com/golang/go/wiki and I wonder whether this is intentional.
IINM, it's like that from the beginning of the Github repository, so
probably
On Thu, Dec 14, 2017 at 11:53 AM dc0d wrote:
> What is the reasoning for not executing //go:generate ... comments inside
a file, that is excluded from build by // +build ignore?
'ignore' is just a tag like any other:
$ cat main.go
// +build ignore
//go:generate
On Thu, Dec 14, 2017 at 6:27 AM Nigel Tao wrote:
> As per https://golang.org/doc/effective_go.html#mixed-caps ALL_CAPS
> names are unusual Go style.
They are, but token names are often/traditionally all caps and underscores:
https://golang.org/pkg/go/token/#Token - in the
On Wed, Dec 13, 2017 at 1:20 PM wrote:
> Could you first answer this question?
The problem is that so far no one seems to be able to understand some/most
of your questions. Please try asking using more words of explanation. The
added context may hopefully help others to
On Wed, Dec 13, 2017 at 10:04 AM dc0d wrote:
> This code compiles and generates no errors. Why?
It's legal code according to the language specification.
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Tue, Dec 12, 2017 at 3:39 PM T L wrote:
> Does it still valid for the latest gc?
> In other words, does gc 1.9 still check the segment [len(s), cap[s]) of a
slice s to find active pointers?
It's not an option, the garbage collector must always scan the whole
backing
On Wed, Dec 6, 2017 at 3:46 PM Jan Mercl <0xj...@gmail.com> wrote:
On Wed, Dec 6, 2017 at 3:41 PM T L <tapir@gmail.com> wrote:
> It would be helpful if you state where do you see the problem so others
do not have to guess.
My apologies, you _have_ stated where do you
On Wed, Dec 6, 2017 at 3:41 PM T L wrote:
> ok, I get it. But how about this:
It would be helpful if you state where do you see the problem so others do
not have to guess.
Anyway, the behavior is correct. The loop equals to
// initially {3, 5, 7}
x[2] = x[0] // {3,
On Wed, Dec 6, 2017 at 11:36 AM Ally Dale wrote:
> I was confused that why fmt "%#v" and "%#q" of string value have
different result.
See: https://golang.org/pkg/fmt/#hdr-Printing
The default format for %v is:
bool:%t
int, int8 etc.: %d
On Mon, Dec 4, 2017 at 1:57 PM wrote:
> i should have mentioned the race detector found nothing. jan, can you
give an example of a go program
> setting a pointer to -1 without using unsafe? this requires the gc to
have free'd something that is still live,
> doesn't it?
See
If course it can.
On Mon, Dec 4, 2017, 07:46 <quans...@gmail.com> wrote:
> a program not using unsafe cannot set a pointer to -1, even if there is a
> race, right?
>
> - erik
>
>
> On Sunday, December 3, 2017 at 10:20:44 PM UTC-8, Jan Mercl wrote:
>
>>
On Mon, Dec 4, 2017 at 7:03 AM wrote:
> does anyone have any idea what's going on here, or some hints on
debugging this?
What does the race detector say?
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Sat, Dec 2, 2017, 20:38 wrote:
>
> Google is not going to be happy if somebody uses Go to compete against
> Google.
>
This is where I stopped considering any of your future posts worth my
attention.
Disclaimer: I'm not affiliated with Google in any way except
On Wed, Nov 29, 2017 at 3:19 PM Subramanian K wrote:
> To run 2GB of data it takes really long time, I am trying to split these
to buckets and make it run concurrently, finally need to collate results of
all these small sorted buckets.
Have you measured and detected where
On Mon, Nov 27, 2017 at 4:00 PM dc0d wrote:
> Is there a way to read from `os.Stdin` in an unbuffered way? (Not waiting
for a `\n` or anything).
n, err := os.Stdin.Read(buf)
does not wait for `\n`. Or do you actually mean setting a terminal in raw
mode?
On Mon, Nov 27, 2017 at 3:18 PM Stefan Nilsson
wrote:
> I fully understand that this can be implemented in many different ways.
That's not my question. Splitting words about "consists of" and "has a"
doesn't add much to the discussion.
I think the distinction is
701 - 800 of 1150 matches
Mail list logo