Jochen Voss wrote:
> Now I just want to run one of these sub-benchmarks. I tried -bench
> '^BenchmarkTextLayout/CFFSimple1$' but this runs two of the benchmarks:
>
> > go test -run=^$ -bench '^BenchmarkTextLayout/CFFSimple1$'
> goos: darwin
> goarch: arm64
> pkg: seehuhn.de/go/pdf/graphics
> Ben
a2800276 wrote:
> I agree it has no technical merit. It can't do better, but it avoid having
> to think about the type mismatch. The functionality provided by ByteOrder
> is fairly simple to begin with, I assume its whole purpose is to reduce
> cognitive load/avoid dumb mistakes. My assumption
a2800276 wrote:
> Just out of curiosity, does anyone have a good rationale as to why there
> are only unsigned conversions available `binary.ByteOrder`? It would seem
> that this functionality is there to avoid dumb careless errors doing byte
> order conversions, but this design forces me to ha
On Tue Oct 3, 2023 at 05:54 AM UTC, Kurtis Rader wrote:
> Thank you to Ian and TheDiveO. I don't understand why functions like
> gocv.io/x/gocv.NewWindow() have to run on the initial OS thread (at least
> on macOS).
It's common for C and C++ libraries to use TLS (thread local storage)
to attach d
On 1/13/23 07:20, Gorka Guardiola wrote:
According to the spec it seems like it is legal to shadow a type with a
variable, even a builtin type.
Is there any specific rationale for this? I guess that it makes scoping
checks easier and faster, but still.
I don't think there is any special rati
On 1/10/23 11:42, Daniel Jankins wrote:
Hi,
Why can you update a value in a map struct?
Sort answer, because m["foo"] is not addressable, but you can have the
desired behavior using a temp variable:
func f() {
m := make(map[string]struct{ i int })
x := m["foo"]
x.i
On 10/9/22 11:09, Dmitry Belyaev wrote:
For a function like below I'd get only *example // doc comment*,
// doc comment
func example() {
// body comment < looking to extract this comment
}
but I am looking also to extract *// body comment*.
Please advise on how to extract function nam
On 08/10/2022 22:56, davy zhang wrote:
Original post on stackoverflow:
https://stackoverflow.com/questions/73985794/for-range-loop-variable-passing-by-reference-to-go-routine-causes-memory-leak
Code for reproducing the problem:
https://go.dev/play/p/7Xzx1Aauzhh
go version go1.19 darwin/amd64
Also, the Output method only returns what was wrote to stdout, tar
argument parsing errors are probably in stderr, using CombinedOutput()
has better effect to debug.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group a
On Wed Apr 20, 2022 at 6:16 PM CEST, Dean Schulze wrote:
> I need to execute this tar command
>
> *tar xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/*
>
Did you considered using the packages "archive/tar" and
"compress/gzip" to achive this?
> *argStr := "xzf dir1/dir2/somefile.tgz --directory=
On Sun Apr 10, 2022 at 4:23 AM CEST, jlfo...@berkeley.edu wrote:
> Other than what's in the Go distribution, I haven't been able to find any
> packages for accessing .a archives. Is there anything else out there?
> Google wasn't helpful.
>
> Cordially,
> Jon Forrest
>
I found these using https://p
On Sat Apr 9, 2022 at 3:56 PM CEST, 'Jack Li' via golang-nuts wrote:
> Why literal operation is exact, variable is not?
>
> fmt.Println(0.1 + 0.2) // 0.3 exactly
> fmt.Println(x + y) // 0.30004
>
Both aren't exact because floats can't represent 0.3 exactly, they
differ because literals
On Thu Mar 10, 2022 at 12:41 PM CET, Manlio Perillo wrote:
> Interesting example, thanks.
>
> But how does `type self *self` works? If I remember correctly, it is not
> discussed in the Language Specification and in The Go Programming Language
> book.
>
I don't think it's mentioned in the specifi
On Tue Nov 30, 2021 at 11:20 PM CET, LastName Almaember wrote:
> It's meant to first read a nine-byte header (8 bits of a type field
> followed by a 64 bit length). In theory, it should work fine, but it
> always immediately returns InputTooShort (right at the first check).
io.Readers returns up t
On Fri May 7, 2021 at 11:10 AM -03, Eric Garcia wrote:
> Was trying to install all the tools, and hit the following errors.
>
> go version 1.16.3
>
> ```
> go get -u golang.org/x/tools/...
>
I think with go1.16 and later the correct way of installing programs
is with go install, it builds clean fo
On Sat May 1, 2021 at 11:12 AM -03, Kamil Ziemian wrote:
> Can you guide me to some materials about const in Go? Or maybe I should
> finally read Go spec, which I avoid for a long time?
>
You shouldn't avoid to read the spec, it's not as complicated as others
languages, and it's a great source of
On Wed Apr 14, 2021 at 12:25 AM -03, Xiangdong Ji wrote:
> I tried to modify fieldalignment to turn its '-fix' option on by
> default, change worked as expected if running fieldalignment as a
> standalone utility, but no rewriting is applied when running it as a
> tool of 'go vet', could any expert
On Tue Apr 13, 2021 at 7:07 PM UTC, Orson Cart wrote:
> I'm perplexed :(
>
Did you tried the /etc/hosts? I think that would do it, if not,
something like this may do the trick:
if debug {
t := http.DefaultTransport.(*http.Transport)
t.Proxy = func(r *http.Request) (*url.URL, error
On Tue Apr 13, 2021 at 2:14 PM -03, Orson Cart wrote:
> Can anyone explain the reasoning behind this? It rather interferes with
> debugging traffic using a local proxy like Fiddler.
>
My guess here it's for preventing the remote from tricking the proxy to
make request to internal services that cou
On Mon Apr 12, 2021 at 10:23 AM -03, Xiangdong Ji wrote:
> Hi,
>
> I'm trying to run "go vet -vettool=$(which fieldalignment) ./..." for a
> large project, and wish to turn its '-fix' option on, wondering how to
> pass
> that option?
Hi Xiangdong, I found that surprising that even docs didn't ment
On Mon Apr 12, 2021 at 5:04 AM -03, Henry wrote:
> The example you gave is actually a map[rune]bool in Go, and not an
> array. I
It's a Go array in form of a composite literal, see
https://golang.org/ref/spec#Composite_literals
--
You received this message because you are subscribed to the Googl
On Wed, 7 Apr 2021 20:11:22 -0400
rob wrote:
> Would it be a bad idea to use my ~go/src as a module?
>
I don't think so, I do have one global module like this for my own toys
and throwaways programs. Yes, it would need to adjust your import paths
according to the module, when I migrated to modu
On Tue, 6 Apr 2021 19:39:00 -0400
rob wrote:
> > This example is on Win10 using go 1.16.3
>
> Now I've created a directory tree outside of ~/go/src. I'm using ~
> to mean %userprofile%, as this is win10
>
> ~/gcode/rpng/rpng.go
>
> ~/gcode/tokenize/tokenize.go
>
> ~/gcode/hpcalc2/hpcalc2.go
On Thu Apr 1, 2021 at 4:45 PM -03, Sharan Guhan wrote:
> r := regexp.MustCompile(`Core Count: [0-9]+`)
> match := r.FindAllStringSubmatch(cmd_output, -1)
As of the "efficiently" part, you should compile the regexp once
instead of each call to ParseFillCpuInfo, a common practice is to use
a package
On Thu, Feb 4, 2021 at 10:32 PM Steve Roth wrote:
>
> How can I implement a writeByte function, against an unknown io.Writer
> implementation, that doesn't allocate heap memory?
>
The only way I'm aware of achieving this is proving to the compiler that
buf is safe to be kept by w by moving buf t
On Mon, Feb 1, 2021 at 11:36 PM eric...@arm.com wrote:
>
> Os: ubuntu 18.04
> Arch: arm64 linux
> go version: go1.15.7
> What did I do:
> $ go get -u golang.org/x/tools/...
> package mvdan.cc/gofumpt/format: unrecognized import path
> "mvdan.cc/gofumpt/format": reading https://mvdan.cc/gofumpt/f
On Tue, 21 Apr 2020 02:22:37 -0700 (PDT)
Rakesh K R wrote:
> In C, we used to typecast this array of uint8_t to predefined
> structure.
>
This is very bad even for a C program, as soon as you dereference
pointer to such structure it's an undefined behavior, and not portable
even on LE architect
On Mon, 16 Mar 2020 20:13:10 +0800
"'Benjamin' via golang-nuts" wrote:
> How do you all think about it?
>
IMO there's no such thing as "Go-style concurrency" if you don't have
`select`, which doesn't looks like this library provides (as many
others).
—wagner
--
You received this message becau
I think that your problem is here: buffer := make([]byte, 6), conn.Read
reads up to len(bufer) before unblocking, and apparently you're trying
to decode an int32, which is 4 bytes long, so your Read call is waiting
for those 2 bytes from your java client to continue.
—wagner
--
You received this
On Thu, 27 Feb 2020 19:03:02 -0800 (PST)
bucha...@gmail.com wrote:
> Can someone please explain the columns printed by "go tool objdump"?
> instruction. I'm not sure what columns 2, 3, and 5 are.
Column $2 is the memory address offset, $3 is the entire instruction
encoded in hexadecimal, $5 is a
On Thu Dec 5, 2019 at 8:27 AM wrote:
> I would hope there would be a JSON file from which I could use to monitor
> releases and obtain download URLs. Something similar to what CoreOS does:
> https://coreos.com/releases/releases.json
GET https://golang.org/dl/?mode=json, then your download link w
On Thu, Aug 22, 2019 at 12:33 PM Wagner Riffel wrote:
> go build uses GOCACHE, not GOTMPDIR. See go help environment.
Sorry, i was wrong, those are supposed to be temporary files, and they
are going correctly to GOTMPDIR for me, not sure what your problem is.
- wgr
--
You received t
On Thu, Aug 22, 2019 at 11:54 AM wrote:
>
> Am I using things wrong?
go build uses GOCACHE, not GOTMPDIR. See go help environment.
- wgr
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails f
>
> I'd bet the default GOPATH, that is $HOME/go
BR.
--
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.
To view this discu
Hi Tenney, clearly something went wrong with /src directory, you
reported your compiler to be go1.12, so it'd be a better idea to
download the go tree from go1.12 release branch instead of tip,
https://github.com/golang/go/tree/release-branch.go1.12
--
You received this message because you are su
This is totally possible, you can either use 'go tool nm' as suggest,
or 'go tool objdump', both tools can answer this question.
go tool objdump -s 'pkgname/internal' a.out
go tool nm a.out | grep 'pkgname/internal'
Be aware that testing against the shown examples, neither A() will be
present, by d
It's not a bug, FormatterA and FormatterB method has different
signatures, they are not identical, one wants Format(StringerA) other
Format(StringerB), thus your Format type only implements FormatterA
but Print wants a FormatterB.
--
You received this message because you are subscribed to the Goo
Last "kkk" print It's not a compiler error due GC, it's just a scoping
rule.
You shouldn't rely on any GC behaviour, GC is not even definied in Go
language spec and its behaviour changes almost every release.
BR.
--
You received this message because you are subscribed to the Google Groups
"golan
> Does Go GC destroy all global vars prior to the end of main() ?
What do you expected to happen? it makes no sense GC do any work, at
moment a process exits it's OS's job to unmmap allocated pages.
FWIW if race detector is enabled runtime does one thing before exit
syscall is invoked: if provide
'⌘' is of type rune (aka int32), "⌘" and `⌘` are of type string, both
takes more than 3 bytes.
--
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+unsubsc
not be used
>> as a key use
>>
>> 在 2019年1月25日星期五 UTC+8下午11:31:57,Victor Giordano写道:
>>>
>>> Yeah, i got the idea. I had already researched about it and what you
>>> can do about it.
>>> <https://stackoverflow.com/questions/50730331/mapping
;s output before the consumer's, then
> this example still can't guarantee it; for example:
> https://play.golang.org/p/2sb67Qf5IPd
>
> the only synchronization guarantee is the moment of exchange on the channel.
>
> On Fri, Jan 25, 2019 at 3:27 AM Wagner Riffel wrote:
>
you can "employ" any custom type as key but the ones that doesn't
defines equality operations, see
https://golang.org/ref/spec#Comparison_operators
as Ian already pointed out, you just can't build your custom type on
top of func, map or slice to be a valid key, anything else you can.
On Fri, Jan 2
maybe it's the way you approached the problem, here is a perhaps cleaner
way to achieve desired output, https://play.golang.org/p/3a4lxbjdQAr
BR.
On Thu, Jan 24, 2019 at 7:12 PM diego patricio wrote:
> Hi all, i'am just learning Go and goroutines, I have three goroutines
> (main, producer, cons
there is nothing to do with special characters in the example you
shown, your xml data is just invalid xml, you're missing root element,
just add it and it should work:
CPUêÿ
btw here is a short version of your program on playground,
https://play.golang.org/p/PhKgVXIcWZl
On Fri, Jan 25, 2019 at 6:
packages have nothing to do with files, if you are on some directory you
don't need to import any package, just use Number on other files
On Thu, Jan 24, 2019, 3:36 AM 伊藤和也 wrote:
> I couldn't import "main" package to other packages to use the variable
> "Number" and I try to use "Number" in ma
i think the term reference is misleading, pointers holds a memory
address, but they are variables, have their own space in memory.
var i int
var p1, p2 = &i, &i
fmt.Printf("%p, %p, %p", &i, &p1, &p2) // 0x1000, 0x1004, 0x1008
while in c++ references variables for example, address are s
Scan() returns false when it reaches EOF or an error, so with what you
provided i assume you're missing to check that.
for ns.Scan() {
...
}
or
for {
if !ns.Scan() {
break
}
-wgr
On Sun, Dec 30, 2018 at 10:36 PM Trig wrote:
>
> I'm currently utilizing the bufio.NewScanner to read ASCII dat
Go has nothing to do with github, you can have any import path and how many
repos you like as long as it exists on your file system inside $GOPATH/src
-wgr
On Wed, Dec 12, 2018, 10:13 AM Sotirios Mantziaris
wrote:
> Hi,
>
> i want to move a repo from my github account to another one. Goal is to
define operator.
-wgr
On Sun, Dec 9, 2018, 10:27 AM Claygod wrote:
> Hello,
>
> I want to try adding a new operator. Tell me, in which packages you need
> to edit the code?
> Maybe once a similar question was discussed, then please give a link
>
> --
> You received this message because you are s
I'm either on 60.3 under linux and it's working fine.
On Fri, Nov 16, 2018 at 1:25 PM Sam Whited wrote:
>
> FWIW, I'm on 65 nightly and haven't noticed any problems (including back when
> 63 was the nightly release).
>
> —Sam
>
> On Fri, Nov 16, 2018, at 09:22, Ian Davis wrote:
> > Hi all,
> >
>
> Where is the dependent github.com/stretchr/testify/assert downloaded - I dont
> see it downloaded any where.
it still download physically, it's under $GOPATH/pkg/mod
On Mon, Oct 8, 2018 at 5:55 PM pprasanthi via golang-nuts
wrote:
>
> I followed below steps to run tests in go mod. In this proce
52 matches
Mail list logo