Another motivation I have heard used is that an os.Exit() from main
by-passes defer(). So if you need to use defer from a "main-like" context
move it to a function called from main(), do your defer(s) in it and then
do the os.Exit() from main()..
On Friday 16 February 2024 at 01:23:57 UTC-8 Mar
For my work, the most common place I handle this is POST JSON => Unmarshal
to Go struct =-> SQL query.
When unmarshaling a JSON body with possibly null fields, like you, I
declare the corresponding Go struct fields as pointers. And have wrappers
IfNullString(), IfNullInt() etc to convert to a s
turn an interface. Or test using the concrete type, instead of using
> mocks.
>
> On Tue, Feb 28, 2023 at 6:08 PM Rick Schubert
> wrote:
>
>> I am having a question about how to implement interfaces correctly in Go
>> when it comes to third-party packages that use
I am having a question about how to implement interfaces correctly in Go
when it comes to third-party packages that use chained methods. I have
compiled an example project below for you so that you can understand the
problem.
package main
import (
myAPI "github.com/hashicorp/vault/api"
)
var
Hi, if anyone has any experience with Luke Roth's gdal package… I'm
relatively new to Go, and very new to GeoTIFF and GDAL, and struggling a
bit.
I'm trying to read data from a 32-bit float band of a GeoTIFF (representing
elevation) and have two questions:
1. Is there any way to directly a
I wouldn't say it's similar to BPEL, but there is Argo
Workflows: https://argoproj.github.io/workflows/. Specific to Kubernetes.
Each step in the workflow is a runs as a pod.
On Thursday, 21 July 2022 at 11:02:37 UTC-7 Crbala Subramanian wrote:
> Hi All
>
> Is there any reference implementation
An email is designated as Spam by a heuristic. The heuristic takes into
account the name of the server where email is originating, properties of
the subject and contents and sender. It's unrelated to the use of Gomail or
any other sending library.
On Monday, 14 March 2022 at 09:11:13 UTC-7 cick
Really? The idea that functions should *never* be longer than 2-3 lines is
absurd. Functions should take an input, do one thing (without side-effect)
and return a result. And their name should indicate what function they
compute. Whether that is 2-3 lines or 20-30 lines depends on the function.
Don't forget to think about cache coherency. Caching is more involved with
multiple caching microservices talking to the database. Creates and updates
require notification of all replicas to refresh their caches.
On Thursday, 9 December 2021 at 23:08:16 UTC-8 Jason E. Aten wrote:
> You might pr
It won't go on forever. The formal proofs are in the original Sapphire and
distributed Train algorithm papers. Informally the proofs show that there
is no way to create a new white object, no way to pass white object between
threads more than a bounded number of times, reachable non-black objec
I'm not entirely following what you are doing. But here are some comments.
You have a directory $HOME/go, the contents of which look like what you
would see under $GOPATH. If you are going to create a project under
$HOME/go (whether GOPATH is defined or not), the suggested place to put it
is in
This is a great practical generics example. Thanks for sharing!
On Sunday, 3 January 2021 at 16:35:38 UTC-8 aphill...@gmail.com wrote:
> I am an avid user of Go who loves how it makes my life so much easier due
> to its amazing simplicity. I am thrilled to find that a great deal of
> progress h
My point of view is that Generics should not become part of the Go standard
library. I appreciate there are use cases where it is very helpful to have,
but I do not believe that adds value to Go. The real value for Go is it's
simplicity, avoidance of generics and avoidance of classes. This makes
se the combination of "-source_path" and "-trim_path" still not work
my project dir tree
macbookpro:tejia_analysis fredlee$ pwd
/Users/fredlee/Documents/xxx/tool/tejia_analysis
macbookpro:tejia_analysis fredlee$ tree util
util
├── analysis.go
├── configure.go
├── cron.go
├── job_discount
I agree with previous posts pointing out that "black lives matter" is not a
political message. In fact, it isn't even a social message. It's a
statement of fact. Please leave the banner up.
On Sunday, 14 June 2020 06:36:38 UTC-7, peterGo wrote:
>
> Recently, a political message with a fundraisin
> type Treenode struct {
> left *Treenode
> right *Treenode
> }
One could of course design a language where Treenode is called cons and
left is called car and right is called cdr and (car nil) is nil and (cdr
nil) is nil. You could implement such a language by putting 2 words of 0 at
location
Breaking the Go CGO pointer rules comes up periodically and the rules
have not changed. Applications have lived with the rules simply
because breaking them results in revisiting the application code
every time a new Go release comes out. Did the compiler improve and
some object is now allocated
One approach is to maintain a shadow stack holding the pointers in a place
the GC already knows about, like an array allocated in the heap. This can
be done in Go, the language. Dereferences would use a level of indirection.
Perhaps one would pass an index into the array instead of the pointer
Please share hello.go Seems likely it's a Windows vs. *nix file file path
issue.
On Saturday, 21 September 2019 17:08:54 UTC-7, Kapil Dev wrote:
>
> Hello Folks
>
> I am novice in Golang. I just installed Golang on my window based machine
> and following are env details
>
>
>
> [image: env_Cap
I am running VSCode with no GOPATH set, the Copls language server selected
and using Go (v 1.13) modules for my projects - works fine.
On Monday, 16 September 2019 11:31:14 UTC-7, joe mcguckin wrote:
>
> I installed this on my Mac. For M$, it actually looks pretty nice.
>
> I had to remap the F1
I second that emotion, brother. Go makes my daily work just a little bit
less irritating.
On Thursday, 5 September 2019 21:55:48 UTC-7, jfrank...@gmail.com wrote:
>
> THIS IS NOT ABOUT MISTAKES IS ABOUT THANKS TO ALL PEOPLE THAT MAKE GOLANG
> A FANTASTIC CHOISE IN THE LANDSCAPE OF PROGRAMMING LA
i read your code, and try to write my code,
package main
import (
"fmt"
"reflect"
)
type A struct{ Name string }
type B struct{ Age int }
type C struct{ Address string }
func Merge(a interface{}, b interface{})( d interface{}) {
aType := reflect.TypeOf(a)
if aType.Kind() != reflect.Struct {
pan
1:25:24,burak serdar写道:
>
> On Fri, Aug 23, 2019 at 11:11 PM Lee Rick > wrote:
> >
> > it's not my need, hope other methods
>
> What is your need? What are the types of the variables d1, d2, d3 in
> your example?
>
> >
> > 在 2019年8月24日星期六 UTC+8上午
29:03,Jan Mercl写道:
>
> On Sat, Aug 24, 2019 at 5:25 AM Lee Rick >
> wrote:
> >
> > i want to do
> > type A struct{ Name string}
> > type B struct{Age int}
> > type C struct{Address string}
> >
> > a, b, c := A{}, B{},C{}
> > have
1:25:01,Kurtis Rader写道:
>
> On Fri, Aug 23, 2019 at 10:11 PM Lee Rick > wrote:
>
>> it's not my need, hope other methods
>>
>
> Then you need to explain why that answer is not satisfactory and otherwise
> better explain your requirements. In your hypothe
it's not my need, hope other methods
在 2019年8月24日星期六 UTC+8上午11:43:32,burak serdar写道:
>
> On Fri, Aug 23, 2019 at 9:25 PM Lee Rick >
> wrote:
> >
> > i want to do
> > type A struct{ Name string}
> > type B struct{Age int}
> > type C struct{
i want to do
type A struct{ Name string}
type B struct{Age int}
type C struct{Address string}
a, b, c := A{}, B{},C{}
have a function
d1 := merge(a,b) //d1 like struct{Name string, Age int}
d2 := merge(a,c) //d2 like struct{Name string, Address string}
d3 := merge(b,c) //d3 like struct{Age int,
When you say "set up GC rate(10%) to reduce memory usage down to normal"
what exactly did the program do?
Compute (CPU) costs money and heap memory (DRAM) costs money. Minimizing
the sum should be the goal. This requires one to have a model of the
relative costs of CPU vs. RAM, HW folks balan
I ran this same program:
https://www.thepolyglotdeveloper.com/2017/05/network-sockets-with-the-go-programming-language/
:
in Linux, and the output was exactly as expected. But on Windows, I was
seeing unexpected results. Sometimes just a newline printed. Sometimes the
entire buffer printed, but
I think what people are trying to explain is that the behavior you may be
expecting based on experience with browsers is not built in to the Go (or
many other) HTTP clients. Even the Java cookie jar which has been mentioned
in this thread was not available in early implementations of Java HTTP
Thanks folks... s/operator/method/
On Saturday, 8 September 2018 18:58:24 UTC-7, Rick wrote:
>
> With recent discussion concerning the possible introduction of generics in
> Go 2, it occurs to me to ask about support for operator overloading in Go
> 2. By this I mean support f
With recent discussion concerning the possible introduction of generics in
Go 2, it occurs to me to ask about support for operator overloading in Go
2. By this I mean support for functions having the same name but different
signature:
func foo(x int) int ...
func foo(x string) bool ...
func f
Hi, try running your code in a debugger, it smells like a DNS resolution
failing, leaving your code awaiting a response.
In a debugger you would be able to see this happening
HTH
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe fr
working in the symbolic AI field though (ontologies,
> > constraint solving and that stuff), not machine learning.
> >
> > Le vendredi 22 décembre 2017 07:33:04 UTC+1, Lee Rick a écrit :
> >>
> >> hi,
> >>Artificial intelligence is a big trend, and i
lang a lot, so I would tend to
> say yes. We're working in the symbolic AI field though (ontologies,
> constraint solving and that stuff), not machine learning.
>
> Le vendredi 22 décembre 2017 07:33:04 UTC+1, Lee Rick a écrit :
>>
>> hi,
>>Artificial intelli
hi,
Artificial intelligence is a big trend, and i want to know whether or
not to consider golang playing a role in artificial intelligence?
Whether to consider developing some basic artificial intelligence
package with support package, use just as python.
--
You received this message bec
hi, when http server receive a request A, create a new http request B with
A, do B, get response respB, create a new http respA with respB
how to do "create a new http request B with A" and " create a new
http respA with respB" with io.copy method, and reset url,params, hosts
etc.
can chime in on if it is
> possible.
>
> I will provide the logs from tonight though. Do you want them zipped here
> in the thread?
>
>
> tis 5 dec. 2017 kl 15:37 skrev Rick Hudson :
>
>> Glad to have helped. The runtime team would be interested in seeing what
>>
Glad to have helped. The runtime team would be interested in seeing what
these pauses look like in the beta. If you have the time could you send
them to us after the beta comes out.
On Tue, Dec 5, 2017 at 9:06 AM, Henrik Johansson
wrote:
> Ok so it's not bad, thats good!
>
> The inital ~20 sec
Interesting idea! Throw in operator overloading to retain the current make
and its signature and the new make with addition of factory arg?
On Sunday, 27 August 2017 11:38:47 UTC-7, RogerV wrote:
>
> Would it be feasible for the built-in make() function to be enhanced to
> also accept a factory
It's reasonable to consider calling a command with a flag that is not
defined an error (whether that flag is -help or -verbose or -whatever). It
is common to return non 0 on error.
On Wednesday, 19 July 2017 11:31:42 UTC-7, Philippe Modard wrote:
>
> Hey go-nuts,
>
> I realize than running `mybi
uble >(int,int) instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double
>(int,int,int) const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int,int,int)
instead.
cp
/Users/fredlee/Documents/开发/go/workspace/src/github.com/lazywei/go-
hi,guys
I wanna wrap opencv2.4.x library to my project by swig, how to do
it?
anyone can give me a demo ?
hope to reply.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving email
i choose https://github.com/olivere/elastic, it works fine.
在 2015年11月5日星期四 UTC+8上午8:21:29,Peter Kleiweg写道:
>
> The website of ElasticSearch lists three Go clients:
>
> https://github.com/mattbaird/elastigo
>
> https://github.com/belogik/goes
>
> https://github.com/olivere/elastic
>
> Does anyone
gc 347 @6564.164s 0%: 0.89+518+1.0 ms clock, 28+3839/4091/3959+33 ms cpu,
23813->23979->12265 MB, 24423 MB goal, 32 P
What I'm seeing here is that you have 32 HW threads and you spend .89+518+1
or 520 ms wall clock in the GC. You also spend 28+3839+4091+3959+33 or
11950 ms CPU time out of total o
You are a good son indeed!
On Tuesday, 3 January 2017 16:36:25 UTC-8, howar...@gmail.com wrote:
>
> This will probably have a very narrow audience (intersection of
> golang-nuts readers and Catholics), but may serve as an example of
> functional audio-processing in Go.
>
> For those unaware, in
Alpine is a lightweight option with official Docker images. You can install
the CERTS using the Alpine package manager:
# apk --no-cache add ca-certificates && update-ca-certificates
On Saturday, 17 December 2016 07:32:32 UTC-8, Alex Flint wrote:
>
> I'm working with busybox, which does not ship
> <https://golang.org/src/runtime/proc.go> and malloc.go
> <https://golang.org/src/runtime/malloc.go> with non-blocking mode. As I
> read the code, GC eschews the fancy concurrent behavior of the new garbage
> collector.
>
> On Tue, Nov 29, 2016 at 11:46 AM, Rick Hudson >
The documentation is correct. The current runtime.GC() implementation
invokes a Stop The World (STW) GC that completes before runtime.GC()
returns. It is useful when doing benchmarking to avoid some of the
non-determinism caused by the GC.
On Tue, Nov 29, 2016 at 1:15 PM, Ian Lance Taylor wrot
I've written a small program for work in gocui and am quite happy with the
results.
On Monday, 28 November 2016 08:12:35 UTC-8, bia...@gmail.com wrote:
>
> i'd like to rewrite an old dos medical patient record program in go for a
> friend. its not a complex program by any means
>
> i'd probably
I recall trying to use the Kubernetes client code some months ago. These
sorts of errors ring a bell. You might try building the Kubernetes project
as a standalone. It's a huge kitchen sink of a thing and not terribly
friendly for someone who wants to do something relatively basic.
On Friday, 2
This is why I love this group.
>
--
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 more options, visit https://group
Hi Johann,
As Jakob pointed out https://github.com/github/git-lfs/lfs is the closest
to a Go library that I know of. Unfortunately, the API is not great and
needs to change. I wouldn't depend on it without vendoring to a specific
commit. Our focus has been working on a stable command line tool,
See os.Exec. Also there is a nice
project https://github.com/codeskyblue/go-sh that friendly's the stdlib up.
On Thursday, 21 July 2016 12:14:04 UTC-7, christ...@google.com wrote:
>
> Cgo enables us to call C functions from Go programs, and we can run C
> functions from command line.
>
> Are we
54 matches
Mail list logo