I made a simple library for personal use awhile ago (
https://github.com/rboyer/safeio) that tries to sequence posix atomic
operations and fsync operations on file and directories for those times
when you just need:
1. create temp file
2. write to temp file
3. fsync and close temp file
Is it idiomatic to use pointers on optional fields? I'm developing a RPC
API and many resources have optional fields. For example AWS SDK[0] seems
to use pointers for all the parameters (received and returned) including
the struct fields. Is there any other way(i.e. best practice) to
distingui
I wrote this as part of a feature in Hugo, the static site generator, to
use the last updated timestamp from the Git repo as the page modification
date. But then I thought it might be interesting to others (and myself), so
I pulled the code into its own repo.
https://github.com/bep/gitmap
A fa
Don't feel frustrated Michael.
All the good advice from everyone here will benefit many more people
besides OP.
I myself learned a lot (especially, me too don't like the idea why channels
has to be involved for such simple task initially, then saw that
mind-opening comment from Paul Borman a
Hey Gophers!
Today I released my library to help with user input validation, called
Legit. I would appreciate any and all feedback.
The difference between existing libraries which tend to use struct tags,
Legit defines an interface requiring types have a method called `Validate`
and exposes he
No, there's no way to do that in Go. There is no preprocessor nor any other
way to obtain the original expression. You'll have to duplicate the
expression as part of your format string.
On Fri, Jul 22, 2016 at 6:57 AM Sam Whited wrote:
> On Thu, Jul 21, 2016 at 7:09 PM, sque via golang-nuts
> w
On Fri, Jul 22, 2016 at 3:40 AM, Manlio Perillo
wrote:
>
> I think your reasoning is wrong.
> WriteFile is a "self contained" function; it does not return the handle to
> the file, so it can not be used inside a transaction.
> I really don't see valid reasons to not call Sync.
WriteFile is a conv
On Thu, Jul 21, 2016 at 7:09 PM, sque via golang-nuts
wrote:
> The "#x" is the really useful part that lets you print the original
> expression. For example, if int a = 4 and int b = 10
This is not exactly the same, but %#v is probably what you want:
https://godoc.org/fmt#hdr-Printing
—Sam
--
>From the today-I-needed department: Bench[0] is a tool for running package
benchmarks in isolation, one by one.
[0]: https://godoc.org/github.com/cznic/bench
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this gr
I've used this macro or some variant thereof in C/C++ for years:
#define dump(x) printf("%s %d: %s = %d\n", __func__, __LINE__, #x,
(int)(x))
The "#x" is the really useful part that lets you print the original
expression. For example, if int a = 4 and int b = 10:
dump(a + b); // Prints "a
On Fri, Jul 22, 2016 at 12:40 PM Manlio Perillo
wrote:
> I really don't see valid reasons to not call Sync.
There are valid use cases where WriteFile produces a transitive file with
no requirements whatsoever to reach any storage above the kernel caches.
Performance in this cases would be [badly
Il giorno giovedì 21 luglio 2016 22:01:52 UTC+2, Konstantin Khomoutov ha
scritto:
>
> On Thu, 21 Jul 2016 21:17:38 +0200
> Manlio Perillo > wrote:
>
> > >> What is the reason why ioutil.WriteFile does not call File.Sync?
> > >
> > > I'd say that's because to inhibit this behaviour when needed
Thanks Chris appreciated :)
On 22/07/2016 02:47, Chris Broadfoot wrote:
A couple people requested a changelog between release candidates. I'll
try to remember to include that for the 1.8 release candidates (we
don't plan to do a 1.7rc4).
GitHub has a nice view for commits between refs.
Here'
13 matches
Mail list logo