I think this is exactly what I need to do...thanks very much. I'm looking
forward to implementing it.
On Saturday, September 12, 2020 at 5:43:09 AM UTC+1 Shulhan wrote:
>
>
> Pada tanggal Sab, 12 Sep 2020 02.54, Andy Hall
> menulis:
>
>> if I have multiple clients connected to a tcp server and
People tend to use strings far too much.
Does tlsCert in this code really need to be a string?
Probably not.
But it it does really need to be a string, then converting to a sting as
you have done is
quite straight forward. And explicit is better than implicit.
The beauty of Go is its simplicity
On 9/12/20 8:25 AM, Tamás Gulácsi wrote:
database/sql.DB is a pool. If you don't want to close it,
SetMaxIdleConns(1), or better, use a db.Conn().
Thanks for the hint.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this g
database/sql.DB is a pool. If you don't want to close it,
SetMaxIdleConns(1), or better, use a db.Conn().
stephan...@gmail.com a következőt írta (2020. szeptember 11., péntek,
21:02:26 UTC+2):
> On Friday, 11 September 2020 at 21:04:11 UTC+3 mar...@gmail.com wrote:
>
>> Which sqlite driver are
Thanks Mhd and agree with the suggestion.
However, we are trying to catch a bug which happens in production on k8s &
hence trying to explore different options.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and sto
Pada tanggal Sab, 12 Sep 2020 08.52, Siddhesh Divekar <
siddhesh.dive...@gmail.com> menulis:
> In writing to a file option, we would periodically write the file as it
> might turn out to be a huge file
> for the entire life of the pod to flush at once
>
Maybe, the obvious solution here is not usi
Pada tanggal Sab, 12 Sep 2020 02.54, Andy Hall
menulis:
> if I have multiple clients connected to a tcp server and I wish to write
> back to specific connections I can record the net.Conn value and then use
> the Write method on it...but when using Println I get the following for two
> clients...
What should happen after the method is added?
Will those types implementing the interface still implement it?
On Thursday, September 10, 2020 at 6:44:29 PM UTC-4 va...@selfip.ru wrote:
> Hi! Does go support adding method to exiting interface via reflect?
> Mostly I need to add method to struct po
Cool.
BTW, there is another docs generator: https://github.com/go101/gold
(written by me).
On Thursday, February 6, 2020 at 7:56:15 PM UTC-5 Trevor Slocum wrote:
> Repository: https://gitlab.com/tslocum/godoc-static
>
> Demo output: https://docs.rocketnine.space
>
> Inspired by the recent news
Still a mistake there. All "MyReader" uses should be "*MyReader".
On Friday, September 11, 2020 at 11:02:49 PM UTC-4 Di gg wrote:
> Sorry, the last 4 lines should be:
>
> rs = (MyReader string)(rb)
> _, _ = rs.Read(s)
> rb = (MyReader []byte)(rs)
> _, _ = rb.Read(bs)
>
> On Friday, September 11,
Sorry, the last 4 lines should be:
rs = (MyReader string)(rb)
_, _ = rs.Read(s)
rb = (MyReader []byte)(rs)
_, _ = rb.Read(bs)
On Friday, September 11, 2020 at 11:00:12 PM UTC-4 Di gg wrote:
> An example demostrating how to let Reader.Read support both string and
> []byte parameters.
>
> package
An example demostrating how to let Reader.Read support both string and
[]byte parameters.
package readonlybytes[T] (
assert T.kind & (String | Slice)
)
package Reader[T] (
assert readonlybytes[T]
){
type Reader interface {
Read(bytes T)(n int, err error)
}
}
package MyRe
In writing to a file option, we would periodically write the file as it
might turn out to be a huge file
for the entire life of the pod to flush at once.
On Fri, Sep 11, 2020 at 6:32 PM Siddhesh Divekar
wrote:
> You need to write to a shared writable path that is global so when the pod
>> termin
>
> You need to write to a shared writable path that is global so when the pod
> terminated the file is avail.
That's a good idea, we can write to to a config map.
The http should work too if you map the ports properly. You can be able to
> access the port from outside the pod.
This might not wo
Because memory is reclaimed - the alloc is the “live” heap. TotalAlloc is a
cumulative counter of byte allocated - bytes freed do not affect the counter.
> On Sep 11, 2020, at 7:14 PM, Alexander Mills
> wrote:
>
>
> Well why does TotalAlloc keep climbing up (increasing) in my program, but
You need to write to a shared writable path that is global so when the pod
terminated the file is avail.
The http should work too if you map the ports properly. You can be able to
access the port from outside the pod.
> On Sep 11, 2020, at 7:14 PM, Siddhesh Divekar
> wrote:
>
>
> I went
I went through the suggested approaches and here are my thoughts.
- runtime/trace.Start - The example in the doc
https://golang.org/pkg/runtime/trace/ suggests adding
os.Create("trace.out"), trace.Start &
defer trace.Stop in the main before the application program gets started.
In an environment l
On Fri, Sep 11, 2020 at 5:01 PM Alex Mills wrote:
>
> The explanations I find online arent very clear to me :(
Well, OK, but I don't know what I can say other than to repeat the
information from that link.
Alloc is bytes of allocated heap objects.
TotalAlloc is cumulative bytes allocated for he
There is a gtk binding, but I'm not sure if it's fully cross platform.
https://github.com/gotk3/gotk3
On Fri, Sep 11, 2020, 6:26 PM Kent Sandvik wrote:
> I tested fyne on my Mac, hey didn't crash, that's a big plus with these
> cross-platform GUI frameworks. The Look&Feel is somewhat different
The explanations I find online arent very clear to me :(
On Thursday, September 10, 2020 at 6:40:34 PM UTC-7 Ian Lance Taylor wrote:
> On Thu, Sep 10, 2020 at 4:39 PM Alexander Mills
> wrote:
> >
> > I have this helper func to print memory usage (detect a memory leak?)
> >
> >
> > func PrintMemU
I tested fyne on my Mac, hey didn't crash, that's a big plus with these
cross-platform GUI frameworks. The Look&Feel is somewhat different but with
some tweaks it could be made manageable. But for any large text-based
application with text styling and so forth I would use Electron or a
similar bro
I had a look again at "Fyne". It seems to have improved a lot lately, in
particular the default size for fonts etc seems much better!
Thanks again for the suggestion.
On Sunday, 2 August 2020 at 23:43:56 UTC+2 ma...@eliasnaur.com wrote:
> On Sunday, 2 August 2020 at 23:24:20 UTC+2 jake...@gmail.
if I have multiple clients connected to a tcp server and I wish to write
back to specific connections I can record the net.Conn value and then use
the Write method on it...but when using Println I get the following for two
clients...
&{{0xc94000}}
&{{0xc94080}}
which when testing with
On 2020-09-11 19:08, Ian Lance Taylor wrote:
> The way Go works, ioutil.ReadFile is compiled with the io/ioutil
> package. It can't change based on how it is called. So it is always
> going to return []byte.
Ok. I figured it might save an allocation as well if the coder made clear their
intentio
On Fri, Sep 11, 2020 at 9:45 AM Kevin Chadwick wrote:
>
> I apologise if this has already been discussed. Google didn't turn up anything
> directly related.
>
> If you read a file using the following that returns a byte slice.
>
> tlsCertb, err := ioutil.ReadFile("/etc/ssl/mycert")
> if err != nil
Please read golang.org/cmd/trace
You need a trace file. There are many ways to capture one.
> On Sep 11, 2020, at 12:09 PM, Siddhesh Divekar
> wrote:
>
>
> Ok, let me get them working first.
>
> My concern with pprof is it has to be made part of my process.
> We had an issue where user req
On Friday, 11 September 2020 at 21:04:11 UTC+3 mar...@gmail.com wrote:
> Which sqlite driver are you using? That sounds like a bug.
>
"github.com/mattn/go-sqlite3"
>
> On Fri, Sep 11, 2020 at 10:56 AM Stephan Lukits wrote:
>
>> I passed a string-type pointer (as last destination) to a sql.DB
Please no. This is just begging for problems.
A simple type conversion is 1 (one!) line and pretty clear.
Once you open this can of worms someone would like
to have a []rune and then automatic conversions from
int32 to int and 6 month later you have a JavaScript
like nonsense language just because
Which sqlite driver are you using? That sounds like a bug.
On Fri, Sep 11, 2020 at 10:56 AM Stephan Lukits
wrote:
> I passed a string-type pointer (as last destination) to a sql.DB.Query
> call which had a NULL value as field value. No error was returned and all
> other fields got the appropriat
I passed a string-type pointer (as last destination) to a sql.DB.Query call
which had a NULL value as field value. No error was returned and all other
fields got the appropriate values but the connection was silently closed.
I noticed because it was an in-memory (sqlite3) database which all of
Apologies in advance if this is not the right group to post this...
I am having a memory leak issue in an app that reads data reports from a
sensor and stores them for a length of time. Running pprof on the app, It
appears that the memory is not getting released when the old data is
purged.
Ok, let me get them working first.
My concern with pprof is it has to be made part of my process.
We had an issue where user requests were not reaching our http server
itself.
In this case what are my options if pprof server is not reachable when we
hit the same issue again.
Are there any other t
I apologise if this has already been discussed. Google didn't turn up anything
directly related.
If you read a file using the following that returns a byte slice.
tlsCertb, err := ioutil.ReadFile("/etc/ssl/mycert")
if err != nil {
log.Fatal(err)
}
tlsCert = string(tlsCertb)
Is there a way to
Hi Kurtis,
Thanks for the reply. I was giving C code to show the behavior of defunct
with threads still executing in a process. I do feel defunct process should
not have any associated resources or threads held.
Could be an issue with this Linux version, will check on the behavior in
Linux com
I would start with making sure you can get the standard ‘go tool trace’ and
‘pprof’ working. Once you have those working ‘goanalyzer’ is an enhanced
version.
The docs are far more complete and substantial on the standard tools.
> On Sep 11, 2020, at 1:37 AM, Siddhesh Divekar
> wrote:
>
>
On Thu, 10 Sep 2020 at 08:15, Yvonne Zhang wrote:
> Hi,
> I have a function streaming a zipreader to browser. It is like this.
> func functionA()(body io.ReadCloser, err error){
>
>// some logic to get a zipreader
>
>body, pipeWriter := io.Pipe()
>zipWriter := zip.NewWriter(pipeWr
36 matches
Mail list logo