Hi, there are cases when this does not work. I tend to use a flag like
-batch or -noninteractive to trigger the correct behavior from within
scripts. Less magic, more control.
Rich schrieb am Do. 8. Juni 2023 um 20:19:
> Hi,
>
> I have a program I am writing that stops and asks the user for
Go can be run on a regular Mac or PC. Maybe you don’t need a tools server
for this at all.
However, in a corporate environment caching dependencies may be a good
thing. With modules this is done by running your own Go proxy. Take a look
at
https://github.com/gomods/athens
or
You can use go:generate and go:embed to achieve this. In our CI/CD pipeline
we generate a json file with a lot of information like vcs, branch, tag,
date and time, hash and a lot more. Then we embed this json into the binary.
I became aware of this technique from
Looking into the spec:
https://go.dev/ref/spec#Return_statements
ReturnStmt = "return" [ ExpressionList ] .
ExpressionList = Expression { "," Expression } .
... no () here
https://go.dev/ref/spec#Function_types
FunctionType = "func" Signature .
Signature = Parameters [ Result ] .
Result
I am curious: from a compiler perspective, does that mean that by using _
simply less assembler instructions are created by not handling those
registers which relate to _?
Marcel Huijkman schrieb am Sa. 5. Nov. 2022
um 09:18:
> When I explain it during my training I always say it is a trashcan
I am also not a native speaker, but having a stream/river in mind, then
upstream seems to be where the water comes from and downstream where the
water is going to.
However, the OP mentioned that one micro service called the other which
tells me something about how the connection is established,
We used the traditional way for a long time. But with the embed package we
stopped this. This is a good blog post on the topic:
https://levelup.gitconnected.com/a-better-way-than-ldflags-to-add-a-build-version-to-your-go-binaries-2258ce419d2d
.
Am Mi., 2. Nov. 2022 um 09:54 Uhr schrieb Jakob Borg
During CI/CD we create a json file with a few details (git tag, branch,
hash, date, time). Afterwards we compile Go Code which embeds this file
into the binary. During runtime flags like --version print the json.
Note that this is about the version of some binary - not the version of a
package.
Hi,
The standard sql package (https://pkg.go.dev/database/sql) comes with a
connection pool. I think it is the DB struct handling the pool.
The drivers which implement the details for a specific database product
usually come with plenty of documentation and examples. See
Would it help to set up your own module proxy e.g. with
https://github.com/gomods/athens or
https://github.com/goproxy/goproxy?
K Prayogo schrieb am Do. 2. Sept. 2021 um 03:54:
> I'm trying to make docker build faster for software that are built with
> golang
> tried to cache layer but it still
I believe you should distinguish between the build and the run environment.
Your build environment is largely defined by the language and its
ecosystem, e.g. the vendor folder has a semantic for the Go tools. After
the build you deploy the resulting artifacts to your run environment. That
may be
I have good experiences with trunk based development meaning that “master”
(we use “main”) is the main development line and you down-port to release
branches with cherry picking and tags. So as soon as you commit something
which is considered a major change (requiring a new version) then also
Several messages during the last weeks irritated me and I guess I was not
the only one. Eventually we are all humans but often enough we don’t treat
ourselves like that. Let’s treat machines like machines and humans like
humans - not the other way round.
That’s why I want to say “Thank you
Most of us do not own a crystal ball but with some code reproducing the
issue (http://sscce.org/) you may get helping answers.
schrieb am Mi. 27. Mai 2020 um 19:07:
> goroutine profile: total 12
> 3 @ 0x1032760 0x10420bb 0x1309343 0x105fc71
> # 0x1309342
t;
> The '-d' option is a shared flag, and `-rt' is dedicated for the
> subcommand 'stream'.
>
>
> On Wednesday, May 6, 2020 at 8:08:25 PM UTC+8, Chris Burkert wrote:
>>
>> Dear all,
>>
>> I'd like to mix shared flags with flags specific to flag sets (cooltool
>
Dear all,
I'd like to mix shared flags with flags specific to flag sets (cooltool
). However I struggle to parse the
shared flags only and pass the rest to the flagset for parsing. Here is
what I came up with:
https://play.golang.org/p/Jazn3aSX9-d
Do I have to pick a different flag library or
That sounds like a good plan. I'm going to try that. Thank you Manlio!
Am Di., 28. Apr. 2020 um 15:11 Uhr schrieb Manlio Perillo <
manlio.peri...@gmail.com>:
> On Tuesday, April 28, 2020 at 10:52:56 AM UTC+2, Chris Burkert wrote:
>>
>> Dear all,
>>
>> m
Dear all,
my application users shall be able to provide multiple json documents
(files and urls) which I'd like to marshall into one structure.
Additionally these json documents may have different versions. I know how
to marshal a document into a version specific struct if I know the format
https://golang.org/doc/faq#Why_is_my_trivial_program_such_a_large_binary
schrieb am Sa. 18. Apr. 2020 um 19:25:
> Why does the simple Hello world program take 2 MB after compilation?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To
Do people ask for a Tesla with a combustion engine? No because they value
what Tesla is doing and why they are doing it. And neither Tesla nor
Kubernetes or Docker are research projects. So please don’t whine about how
things are. Instead (as Ian said) participate in a positive manner and
learned something new.
many thanks to both of you
Am Fr., 13. März 2020 um 19:47 Uhr schrieb brainman :
> On Friday, 13 March 2020 08:58:24 UTC+11, Chris Burkert wrote:
>>
>> Dear all,
>>
>> besides other environments I have a company laptop running Windows 10
>&g
Dear all,
besides other environments I have a company laptop running Windows 10
Enterprise with WSL and Ubuntu. In Ubuntu I installed Go 1.14 and wanted to
play around with Gio for fun. However it seems that McAfee doesn't want me
to.
In short this is what I do and (mostly) get:
$ cd ~
$ mkdir
Take a Look at
https://blog.golang.org/json-and-go:
The json package uses map[string]interface{} and []interface{}values to
store arbitrary JSON objects and arrays; it will happily unmarshal any
valid JSON blob into a plain interface{} value. The default concrete Go
types are:
- bool for JSON
Hello, we are working on a pure Go implementation of the TDS protocol for
https://github.com/SAP/go-ase (which is currently just a cgo driver). I am
not sure if TDS is also understood by SQLAnywhere but if so, then this may
help. I will see if I find more in the company and let you know.
reda
You could inject your dependencies. There is a funny talk by Liron Levin
[1] which helped me a lot.
1: https://youtu.be/_B_vCEiO4mA
prakash sharma schrieb am Sa. 11. Jan. 2020
um 16:24:
> Need help:
>
>
xt := {} leaves the templates field nil.
Ehioje Henry Erabor schrieb am Mi. 8. Jan. 2020 um
15:59:
> I am having issues using extemplate library in my echo framework project.
> Library :https://github.com/dannyvankooten/extemplate
>
> My Code is below:
>
> Enter code here...package main
>
>
ask was to limit the whole thing to about 10% of cores)
>
> I still don't think you needed a worker pool here. Like OP mentioned
> above, you could just limit the number of goroutines executed to 10% of
> total cores.
>
>
> On Saturday, 28 December 2019 18:02:08 UTC+5:3
There are Pros and Cons for everything in life. Some time ago I wrote a
database tool which does something per table where the runtime largely
depends on the table size. I started with one goroutine per table because
it was easy. But that put a high load on the database (the task was to
limit the
Dear Kevin,
is there some code available to dig into that? I plan to do something
similar that a regular user process starts up a kind of a root broker which
starts several other processes as different users. Especially for the
communication part I don’t have a good and secure idea so far.
thanks
they are intrinsically motivated the English language is not a
hurdle for them. That’s why I was wondering about the article.
Thanks for all your comments. Reading the different perspectives about the
topic fascinates me a lot.
Chris Burkert schrieb am Mo. 29. Apr. 2019 um
07:35:
> I recently read an arti
I recently read an article (German) about the dominance of English in
programming languages [1]. It is about the fact that keywords in a language
typically are English words. Thus it would be hard for non English speakers
to learn programming - argue the authors.
I wonder if there is really
John, the Web Browser communicates with the Web Server using the http
protocol. So http is the definition how they interact with each other. It’s
not a language but a protocol.
The Web Browser can display (or render) stuff which has been transferred
via http. This could be some HTML with the help
For me Go is the small but complete toolbox you need to build anything. Tim
Allens Home Improvement and Binford comes to my mind :-)
Randall O'Reilly schrieb am Sa. 23. Feb. 2019 um
05:40:
> On the topic of “selling” the advantages of Go vs. other languages such as
> Python and C++, has anyone
In case of a non-nil error Close will not be executed and that is exactly
what you want. The power of defer becomes obvious with more code after the
defer which does not have to deal with any cleanup of previous steps
because of the defer.
Am Fr., 4. Jan. 2019 um 07:09 Uhr schrieb 伊藤和也 :
> In
Pointers are useful to pass around shared state. Values are usually copied
so changes on one copy are not visible on the other. Pointers on the other
hand are an address to some value (and the address is also copied by
passing it around) but the value these addresses point to is exactly one
same
cause the logger was slow
>
> For the performance aspect, you are essentially increasing the
> parallelism, since any “block/wait” degrades this
>
> Hope that helps.
>
>
>
> On Dec 18, 2018, at 1:49 PM, Chris Burkert
> wrote:
>
> Robert,
> it seems to me t
be you are not and it s up to you to work around.
> This becomes a problem when the code can t be rationalized via an api that
> is able to wrap those behaviors.
>
> On Tuesday, December 18, 2018 at 8:50:20 PM UTC+1, Chris Burkert wrote:
>>
>> Robert,
>> it seem
rker)
> for i := 0; i < worker; i++ {
> go do(i, rc, dc)
> }
> for done < worker {
> r := <-rc
> fmt.Println(r)
> <-dc
> done++
> }
> }
>
>
> On Tue, Dec 18, 2018 at 5:35 AM Chris Burkert
> wrote:
>
>> Dear all,
>>
>> I have a couple
correct me if I am wrong.
Chris
Justin Israel schrieb am Di. 18. Dez. 2018 um
19:08:
>
>
> On Wed, Dec 19, 2018, 5:31 AM Chris Burkert
> wrote:
>
>> Hello Ian, all,
>> yes, the workers generate multiple results. I was able to use your
>> proposal with t
}
}
return n
}
Am Di., 18. Dez. 2018 um 15:50 Uhr schrieb Ian Lance Taylor :
> On Tue, Dec 18, 2018 at 5:35 AM Chris Burkert
> wrote:
> >
> > I have a couple of goroutines sending multiple results over a channel -
> a simple fan-in. They signa
Dear all,
I have a couple of goroutines sending multiple results over a channel - a
simple fan-in. They signal the completion on a done channel. Main selects
on the results and done channel in parallel. As the select is random main
sometimes misses to select the last result. What would be the
Hello Hay,
with interface{} you explicitly allow everything. Instead you may consider
to restrict the accepted input in the first place - e.g. with a non-empty
interface.
Chris
hay schrieb am Mo. 19. Nov. 2018 um 15:37:
> Hi,
>
> I've the following example code of correct version.
>
> func
Maybe episode #35 from justforfunc (https://youtu.be/XbKSssBftLM) answers
what you’re searching for.
Alex Dvoretskiy schrieb am Mo. 29. Okt. 2018 um
20:21:
> Looking for a Go code or algorithm, in general, to print out directory
> structure.
>
> Example: https://jekyllrb.com/docs/structure/
>
>
t from %d\n", remaining, amount)
case <-donChan:
remaining--
case res := <-resChan:
fmt.Println(res)
}
}
thanks all!
Chris
On Saturday, May 19, 2018 at 9:16:19 PM UTC+2, Jakob Borg wrote:
>
> On 19 May 2018, at 16:25, Chris
at 16:25, Chris Burkert <burkert.ch...@gmail.com> wrote:
> >
> > case <-time.After(5 * time.Second):
> > fmt.Printf("Progress: %d left from %d\n", remaining, amount)
>
> It's not super clear from your post if you're aware of this already, but
Dear Gophers,
I am working on a small database tool which checks a database for
inconsistencies. It does that by calling a stored procedure via sql.
Unfortunately the database client is available as C-library only but
luckily there is a go driver for the database/sql package so at least it
46 matches
Mail list logo