What exactly beside the information in https://go.dev/blog/govulncheck
and especially https://go.dev/doc/tutorial/govulncheck do you want
to discuss?
V
On Monday 11 March 2024 at 00:49:17 UTC+1 Colton Freeman wrote:
> Disregard. Figured out the tool (a little better). Would still love to
>
Ah, and one more:
On Monday, 27 November 2023 at 13:12:54 UTC+1 fliter wrote:
BenchmarkTest1-83572733433.51 ns/op 192
B/op 1 allocs/op
BenchmarkTest2-81471724258.157 ns/op 0
B/op 0 allocs/op
BenchmarkTest3-8
On Monday, 27 November 2023 at 13:12:54 UTC+1 fliter wrote:
But why not optimize byte slicing to string conversion together?
Try to implement that conversion and you'll see.
Note that strings are immutable, even if converted
from a byte slice (which are by their very nature)
mutable. Good luck
On Thursday, 9 November 2023 at 18:35:38 UTC+1 Viktoriia Kapyrina
Yelizarova wrote:
] array_intersect is a common example of automation. It makes no sense to
right it again and again as it is common operation which works the same way.
Except that almost all implementations of array_intersect
;
> El vie, 20 oct 2023 a las 14:48, Victor Giordano ()
> escribió:
>
>> Volker. I don't know how to reply to what you state. I'm open to listen
>> or read any thoughts you have about not using bool to int.
>>
>>
>> El vie, 20 oct 2023 a las 12:20, Volke
I use 1 a lot and 4 (or the suggested bool<-->int conv) never.
I have no idea what you want to express with 2
and 4 addresses a kind of problem that has no
simple solution like a one-line function.
V.
On Friday, 20 October 2023 at 15:12:06 UTC+2 Victor Giordano wrote:
> Hello fellow
have to find some
way to read more (???) or reset the Reader and this has
nothing to do with _how_ you read from that Reader.
V.
On Tuesday, October 17, 2023 at 4:37:58 AM UTC-4 Volker Dobler wrote:
Why do you use a json.Decoder? It seems as reading
everything (io.ReadAll) until EOF
Why do you use a json.Decoder? It seems as reading
everything (io.ReadAll) until EOF and json.Unmarshal'ling
would be a cleaner/simpler solution?
V.
On Tuesday, 17 October 2023 at 09:10:09 UTC+2 Christopher C wrote:
> Hello all!
> I'm trying to read json objects from a named pipe. The pipe
> Best IDE for G[o]?
This is hard to answer like most "best" questions.
What is the best dish? The best movie.
The best vacuum cleaner?
But honestly its emacs of course.
V
On Saturday, 19 August 2023 at 11:27:34 UTC+2 alex-coder wrote:
> Hi All !
> Gophers, there is at least 10 years as GO on
On Tuesday, 4 July 2023 at 17:39:05 UTC+2 Gurunandan Bhat wrote:
Every example of http Handler that I have seen so far looks like this:
This is very strange as basically all correct http Handlers I have
seen in the last 10 years actually do return after http.Error.
If all examples of http
On Monday, 13 March 2023 at 17:41:42 UTC+1 Van Fury wrote:
Relating to my previous question, I have been reading but it is still not
clear to me what raw binary is, how is it different from
text formatted binary (fmt.Sprintf("%b", s1s2Byte))?
"text formated binary" takes a stream of bytes and
On Monday, 13 March 2023 at 12:24:15 UTC+1 Van Fury wrote:
Sorry I did not frame my question properly but what I would like to do is to
encode concatenated s1 and s2 into raw binary and then decode the raw binary
back to s1 and s2.
The only problem is knowing where s1 ends / where s2 starts.
So
You cannot have multiple packages (in your case main and goprorename)
in one folder. This has nothing to do with modules. You must but these
three files into two different folders based on their package declaration.
You might want to work through https://go.dev/doc/code
V.
--
You received this
On Sunday, 4 December 2022 at 15:13:46 UTC+1 ren...@ix.netcom.com wrote:
> Can’t you use a replace directive to use the fork ?
>
No, not in the general case.
V.
>
> On Dec 4, 2022, at 6:17 AM, Volker Dobler wrote:
>
> You cannot use a "fork". The Github concept
You cannot use a "fork". The Github concept of a "fork" doesn't
work together with the concept of a Go module.
You are free to fork a repo and you can modify the source
after git cloning your "fork" you even can build the "fork" and
go install it's binaries by simply running go install inside
of
On Tuesday, 22 November 2022 at 11:28:15 UTC+1 nikhil...@gmail.com wrote:
> [...] the duration value should never be less than 0 else it will panic
>
This statement is wrong, a negative time.Duration doesn't panic.
(Maybe you are talking about time.Sleep?)
Is there any reason for not using uint?
On Saturday, 22 October 2022 at 22:25:16 UTC+2 dple...@google.com wrote:
> that the above function is much easier to read and much faster to write
True but in my opinion not relevant because:
1. Time to write a function is almost negligible compare to its
time needed for maintenance, rewrites,
Executing code during build is a 100% no-go from a security perspective.
Especially arbitrary 3rd party code.
So let me rephrase it:
> One of the big advantages of Go's build systems is that running
> generators is **not** automated.
V
On Monday, 8 August 2022 at 12:34:43 UTC+2
On Thursday, 30 June 2022 at 00:31:29 UTC+2 amits wrote:
> Currently the Cookies() method as explained at
> https://pkg.go.dev/net/http/cookiejar#Jar.Cookies only adds the Name and
> Value of the cookies and strips out the MaxAge and Expires field (and all
> other fields). Presumably, as I can
If you want the command to be installed: Why don't you install
_the_ _command_ with
go install https://github.com/chmike/clog/cmd/clogClr@latest
? (Note that there is no need to install the package.)
V.
On Wednesday, 25 May 2022 at 08:13:58 UTC+2 christoph...@gmail.com wrote:
> I have a
>
>
> Does anyone know what the upper bound on this could be?
>
>
Yes, I do: math.MaxUint64 !
The nice thing about upper bounds is that they can be larger than
the least upper bound :-)
V.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
On Friday, 3 September 2021 at 02:18:54 UTC+2 Connor Kuehl wrote:
> But this whole time as I've been learning the language, the standard
> packages can be imported without any explicit prefix:
>
> import "fmt"
>
> and I found a go.mod in my Go distribution's standard library [1], so
> that
On Sunday, 29 August 2021 at 09:47:09 UTC+2 Brian Candler wrote:
> To be pedantic, Len(9) == 4
> :-)
>
Me stupid :-(
--
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
On Thursday, 26 August 2021 at 22:17:55 UTC+2 kziem...@gmail.com wrote:
> Another topic. I needed to check package "math/bits" (learning about Go
> can lead us in such places quite fast) and I'm confused about function
> "Len(x uint) int". In its description we have (
>
On Thursday, 26 August 2021 at 13:27:01 UTC+2 kziem...@gmail.com wrote:
> Line "early regular expression implementations used and that POSIX
> specifies" is a bit confusing to me. I guess it can mean "old
> implementations Go regexp package",
This guess is wrong. Go's regexp package did and
1. It's a made up dummy
2. You cannot and you need not.
V.
On Wednesday, 28 July 2021 at 18:02:03 UTC+2 isma...@gmail.com wrote:
> My `go.mod` file looks like
> ```
> module school
> go 1.13
> replace sample.com/math => ../math
> ```
>
> When I run `go run school.go` the `go.mod` file
Note that the compiler should generate efficient code for
common, typical, real-world code. Optimising the compiler
to generate the most efficient code for pathological code
can be a waste of time, both for the compiler writers and
for the users waiting longer for their "normal" code to be
On Tuesday, 1 June 2021 at 18:39:48 UTC+2 beeke...@gmail.com wrote:
> How are golang web applications on a scale of 1 to 10 for seo rankings?
They range from 1 to 10 depending on how they are implemented.
SEO ranking is not influenced by the language you write your "web
application" in.
V.
On Friday, 9 April 2021 at 17:38:12 UTC+2 gonutz wrote:
> A replace in the go.mod file is of no help here because I still have to
> specify a require with a concrete version or commit hash for the library.
>
Why do you think so? Replace with your local filesystem path
of the library requires
Probably you are overthinking it. Start like this
go mod init me.nil/project
It doesn't matter whether you want to publish your project or not you must
start with a module and a proper name including a dot and a slash doesn't
harm and avoids several problems. Of course you also could name it
On Wednesday, 3 March 2021 at 08:35:49 UTC+1 rolf...@gmail.com wrote:
> In my not painless transition from GOPATH to modules, I would like to
> understand why import paths without a version are not equal to 'latest',
> which is what happens in many other contexts: no version specified, use
>
On Thu, 25 Feb 2021 at 09:08, Paul Förster wrote:
> Hi Volker,
>
> > On 25. Feb, 2021, at 08:46, Volker Dobler
> wrote:
> >
> > I think there is a major problem with "go run main.go": It creates
> > a _false mental model_ of how Go code is built a
On Wed, 24 Feb 2021 at 20:00, Ian Lance Taylor wrote:
> On Sat, Feb 20, 2021 at 8:26 AM Volker Dobler
> wrote:
> >
> > 1. Do not use go run main.go. Never!
>
> I want to point out that this is too strong. There are perfectly good
> reasons to use "go run main
On Tuesday, 23 February 2021 at 07:01:27 UTC+1 Henry wrote:
> I think the problem is that people try to use embedding in place of
> inheritance. [...] Embedding shares many similarities to inheritance
The first part is a real common problem but I have to admit I do not
understand
where the
On Monday, 22 February 2021 at 15:03:53 UTC+1 Khosrow Afroozeh wrote:
> type List[T any] []T
>
> 1. The current go2go implementation does not allow one to do this:
>
> func ToList[T any](v []T) List[T] {
> return List(v)
> }
>
> with the error: List(v) is not a type
>
> Is this a bug,
(premature send, sorry)
4. Your matrix multiplication is just a few CPU instructions, it is hard
to measure something tiny reliable. So use larger matrixes.
5. You are benchmarking also how fast you can format and output
the results to stdout. This might or might not be intentional but
probably
1. Do not use go run main.go. Never!
2. Do not run your code with the much less problematic go run because
go run compiles and executes your code and the time needed to compile
it will ruin all benchmarks.
3. Always use the benchmarking infrastructure built into go test and
and package testing.
I think there is strong consensus, that the current style of error handling
is currently the best option. Nobody has been able to come up with
something better (really better, not just more comfortable while ignoring
hefty drawbacks).
It is true that a loud minority seems to miss exceptions to
You either have to use the "replace" directive in go.mod, or:
Do not work on the fork. Do your work on a plain _clone_ of the
repo (which works without "replace"ing dependencies).
To create a Github PR: git push to your fork (add it as an additional
git remote) and create the PR. The "fork" is
One way to do this is have an internal implementation like
func generatorImpl(sleep func(time.Duration)) <-chan int
and func generator just calls that one with time.Sleep.
Tests are done against generatorImpl where you know have
detailed control of how much (typically none) time is
actually slept.
On Sunday, 3 January 2021 at 18:43:22 UTC+1 ren...@ix.netcom.com wrote:
> I do believe (hope) David was kidding. Anonymous product types (and
> similar constructs) are the root of all evil.
>
Yes, you need dependent product types. Especially anonymous ones.
(Just be be clear: I _am_ kidding.)
Use
import _ "embed" // note the _
Your code does not use package embed. A comment does
not qualify as usage. As yous must import it for //go:embed
comments to work you have to use a "side-effects-only"-import.
V.
On Friday, 18 December 2020 at 13:38:10 UTC+1 amits...@gmail.com wrote:
>
You cannot do this.
1. You cannot add methods to imported types.
2. Embedding is not inheritance. (While sometimes things which
are often done via inheritance can be done with embedding too
embedding simply is not inheritance and leads to a totally different
type.)
3. Go's slices (and arrays)
On Wednesday, 16 September 2020 at 10:51:27 UTC+2 stephan...@gmail.com
wrote:
> Assume a public interface I with two methods NotInS and M whereas NotInS
> is calling M. An implementation i of I which implements NotInS and M as
> well as a specialization s of i which only implements M. Finally
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
In practice you never declare the same interface twice
switch from one to the other. Why would anybody declare
his own ResonseWriter interface if net/http.ResponseWriter
exists?
So yes: Using a type alias has advantages, but no, this
advantage is never realized because neither the alias nor
the
On Thursday, 27 August 2020 11:39:11 UTC+2, targe...@gmail.com wrote:
>
> To me, if `x == nil` and then `y != nil` after `y = x` is much more
> confusing.
>
This can happen only if x and y have different types.
And for different types this is pretty normal as you can have
x == 0.2 //
On Friday, 21 August 2020 20:15:46 UTC+2, burak serdar wrote:
>
> [...]
> I don't see why anybody would find it attractive as a return type. People
> don't use the empty interface because they like it so much, but because Go
> doesn't have parametric polymorphism / "generics" yet. There are
On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote:
>
> Isn't this the default location? I just untarred the distribution...
>
No. There is a reason https://golang.org/doc/install#install
states to do tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
V.
--
You received this
On Friday, 14 August 2020 13:00:19 UTC+2, xie cui wrote:
>
> the return instance of reflect.TypeOf(some object) should be generate by
> compiler, the type info which could be in elf files. i want to known where
> compiler generate it.
>
Maybe this is the reason for your confusion.
Your
n Friday, August 14, 2020 at 1:32:25 PM UTC+8 Volker Dobler wrote:
>
>> The value returned by reflect.TypeOf is not computed during
>> compile time but during run time. The code for package
>> reflect is generated by the compiler during compile time
>> but thi
The value returned by reflect.TypeOf is not computed during
compile time but during run time. The code for package
reflect is generated by the compiler during compile time
but this is not interesting to understand reflection at all as
it is the same code generation like for lets say net/http.
The
On Friday, 31 July 2020 04:55:50 UTC+2, jules wrote:
>
> Modules are a great idea and I want to use them, but I can't get it to
> compile
> a "hello golang" program even:
>
> ===
> $ ls /home/jfields/go/src/jsonstuff
> typestuff.go
> $ go mod init src
> go: creating new
The best advice is: Read How to Write Go Code
https://golang.org/doc/code.html
and stick to it.
Yes, modules are the thing to be used
1. But naming a module "src" is begging for trouble.
Name your module either something like
julesgocode.org/firsttry
or maybe
github.com//firsttry
2. If your
On Tuesday, 21 July 2020 05:06:11 UTC+2, Bit0r Mack wrote:
>
>
> Among them, is the most convenient to input,
> because < and? Are very close on the keyboard, so you can input quickly
>
< and ? on my keyboard are almost the most distant keys
(_ and ° having the same distance and < and ^ being
On Tuesday, 30 June 2020 18:16:54 UTC+2, lqiy...@gmail.com wrote:
>
> $ go version
> go version go1.13.10
>
> In the container, the golang process used 100% of the CPU. When I took a
> 5minutes CPU profile, the result shows that only 1.64mins (32.69%) samples
> are returned. Is it normal?
>
> go
On Tuesday, 30 June 2020 06:34:48 UTC+2, Jason E. Aten wrote:
>
> I have a files laid out like this (OSX):
>
> ~/go/src/github.com/user/fish/api/client/wanda.go
>
> ~/go/src/github.com/user/fish/go.mod with first line "module
> github.com/liked/movies/v2"
>
>
> If I use append() instead of Printf(), this expanding of the host
> variables just works out. Is this a compiler bug in the case of the
> fmt.Printf() ?
>
I doubt that
append("%v.%v.%v.%v\n", host[0:4]...)
does compile.
V.
--
You received this message because you are subscribed to
On Thursday, 18 June 2020 10:15:16 UTC+2, Nathanael Curin wrote:
>
> An argument for this is also that (all ?) languages that use generics use
> <>. It might make learning just easier for new Go developers that have
> experience from generics-compatible languages.
>
And an argument against
You are supposed to run the loop b.N times, not
some fixed constant. Also make sure the compiler
doesn't optimize away the whole function.
V.
On Tuesday, 19 May 2020 18:20:43 UTC+2, Warren Bare wrote:
>
> Hi Folks,
>
> I'm getting weird results from Benchmark. Maybe someone can help me
>
Go, the language and the std tooling has no predefined
way of doing this. Do whatever fits your need.
V.
On Sunday, 17 May 2020 19:19:23 UTC+2, Shishira Pradhan wrote:
>
> Hi All,
>
> i'm a java developer, currently working on golang. In springboot, we have
> configuration like port, database
On Saturday, 9 May 2020 09:57:50 UTC+2, Amarjeet Anand wrote:
>
> While writing unit test, what should be the preferred way to mock an
> external(database, http...) call, *function based approach* or *interface
> based approach?*
>
> I don't understand when to use function way and when to use
On Monday, 27 April 2020 18:46:20 UTC+2, valen...@gmail.com wrote:
>
> Why is it necessary to write func in go before declaring a function; if in
> C, when parsing a function, there is no such need?
> Why "func sum(a, b int) int {...}" can't be "sum(a, b int) int {...}"
>
Of course it could be
On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote:
>
> In the Go tour at https://tour.golang.org/methods/19 it says
>
> The error type is a built-in interface similar to fmt.Stringer:
>
> The words closest to "similar to" are "built-in interface", implying
> that the way error
On Wednesday, 8 April 2020 18:17:36 UTC+2, Tanmay Das wrote:
>
> Is this behavior expected? If it is, why did the go authors make such a
> decision? I mean making the internet connectivity a dependency for the
> execution of a program sounds counter-productive to me, honestly. :(
>
Well, go run
That _is_ the correct way iff req is not nil.
Check your errors first.
V.
On Wednesday, 18 March 2020 06:22:07 UTC+1, Alexander Mills wrote:
>
>
> hey all I am trying to read the Response from http.Request like so:
>
> func (ctr *Controller) Login(c *common.CPContext, req *http.Request, res
>
On Monday, 16 March 2020 14:25:52 UTC+1, Nitish Saboo wrote:
>
> Hi,
>
> I upgraded the go version and compiled the binary against go version 'go
> version go1.12.4 linux/amd64'.
> I ran the program for some time. I made almost 30-40 calls to the method
> Load_Pattern_Db().
> The program starts
The go tool works well if you use package import path
as arguments.
On Wednesday, 11 March 2020 20:49:53 UTC+1, Dean Schulze wrote:
>
> Well here's what I get in my module with a single directory with a single
> file with a single package called lib:
>
To be concrete let the module name be
This is normal behaviour and not a leak.
Nothing is leaking in your code (and it is generally
hard to leak RAM). The allocations will be reclaimed.
V.
On Friday, 6 March 2020 14:11:37 UTC+1, Christophe Meessen wrote:
>
> I wanted to check my program for go routine and memory leaks. In doing so
On Wednesday, 26 February 2020 20:53:52 UTC+1, geoff.j...@gmail.com wrote:
>
> This baffles me:
>
>
> $ go build foo.com/foobar
> can't load package: package foo.com/foobar: cannot find module providing
> package foo.com/foobar
>
>
You simply cannot build a module. Only packages can be built.
and
It boils down to the meaning of interface{}.
interface{} means interface{} and _not_ "any type".
While you can assign anything to a variable of type interface{}
this does not mean that a variable of type interface{} _is_
"any type". There is no "any type" type in Go.
V.
On Sunday, 23 February
On Wednesday, 19 February 2020 11:59:33 UTC+1, klos...@gmail.com wrote:
>
> [...]
> But if you create wood houses for people, you don't even think of using a
> hammer! You will use a much more reliable tool. Or if you use it, it will
> probably be the best hammer in the market, with a perfect
On Tuesday, 18 February 2020 12:44:16 UTC+1, klos...@gmail.com wrote:
>
> Well, other languages use the optional/maybe type. It handles sentinel
> values pretty well and I don't think they bring new kind of bugs (while
> they remove the nil-pointer related bugs).
>
That is the market claim.
Build tags are per build, not per package.
So no, you cannot.
V.
On Wednesday, 29 January 2020 04:03:15 UTC+1, Henry wrote:
>
> Hi,
>
> I wonder whether it is possible to specify a dependency's build tags in go
> module. Let's say that Project A depends on Library B. Library B has
> optional
On Monday, 27 January 2020 12:27:35 UTC+1, changkun wrote:
>
> Dear golang-nuts,
>
> As https://github.com/golang/go/issues/27151,
> https://github.com/golang/go/issues/6853 and many relevant issues
> discussed, Go download is huge.
>
Neither of these issues benefits from splitting the stdlib
You either need the full import path of the package to test or a simple
$ go test
V.
On Wednesday, 22 January 2020 10:52:41 UTC+1, pc wrote:
>
> Hello,
>
>I am setting up my go project directories to test. I have set up like
> bellow
> and my GOPATH is testexercise. Application builds
On Thursday, 9 January 2020 16:39:40 UTC+1, rk303...@gmail.com wrote:
>
> I have one exe file which contains code written in the Go language. I
> don’t have a source code for this. Is there a tool or technique by which I
> can determine the code Coverage for this executable [?]
>
No, for
On Tuesday, 3 December 2019 18:36:49 UTC+1, Bruno Albuquerque wrote:
>
> It will fail because it will say it can not find "project"
>
> If I add a proper go.mod file in the example directory, then it works but
> it actually pulls a version of project from the vcs (this is, of course,
> assuming
On Friday, 8 November 2019 05:47:03 UTC+1, Kasun Vithanage wrote:
>
> What is the best approach?
>
There is no single "best approach".
If two goroutines A and B access two different indices iA and iB you
do not need any synchronisation between them. If iA==iB you need
to protect reads from
Hi
I think one of the main struggles stems from "dependency" having two
technical meanings:
a) If a package a imports a package b then a depends on b.
This is a priori agnostic to versions.
This type of dependency is expressed by a simple import
"import/path/of/b"
in a's source
In general: You cannot use a Github Fork of a Go module.
A fork creates a new package/module with different package/module
names and in general (trivial cases _do_ work) you cannot even build it.
What you should do:
- Fork the repo but do not work on your fork!
- Clone the repo you want to work
On Tuesday, 13 August 2019 17:03:36 UTC+2, jochen...@gmx.de wrote:
>
> type X Y is a type declaration, you have to cast between the types
> type X=Y is a type alias, where X can be used as Y without casting
>
There are no type cast in Go. Only type conversions.
V.
--
You received this message
On Tuesday, 13 August 2019 09:43:05 UTC+2, Jan Mercl wrote:
>
> On Tue, Aug 13, 2019 at 9:24 AM Volker Dobler
> > wrote:
>
> > Yes, of course. It declares a new named type X, the underlying
> > type is Y which can be some predeclared type like int, some
> >
On Tuesday, 13 August 2019 08:10:56 UTC+2, Sathish VJ wrote:
>
> So doing *type X Y* is just a type declaration then?
>
Yes, of course. It declares a new named type X, the underlying
type is Y which can be some predeclared type like int, some
other named declared type (like MyFooType) or a "type
gt;> 253563 | 5.3980% | :
>> 155297 | 3.3061% | :=
>>
>> *138465 | 2.9478% | [138465 | 2.9478% | ] *
>> 78567 | 1.6726% | !=
>> 72007 | 1.5329% | *
>>
>> On Wed, Jun 12, 2019 at 1:51 PM Volker Dobler > > wrote:
>
Cool work!
What I found most astonishing on a first look: Not all
parentheses ( are closed: 4 ) seem to be missing??
For { 5 are unclosed while there is one more ] than [ ?
Are you parsing testfiles with deliberate errors?
V.
On Wednesday, 12 June 2019 15:08:44 UTC+2, Michael Jones wrote:
>
>
I think this boils down to: Your code is _missing_ the relevant CAS
from the original code.
V.
On Tuesday, 30 April 2019 05:18:39 UTC+2, jacki...@gmail.com wrote:
>
> On line 85 in
> https://github.com/golang/go/blob/release-branch.go1.12/src/sync/mutex.go ,
> the code " old := m.state " is
The number of keywords and their "origin language" does not matter
much, that is something we probably can all agree to, especially
with the very few kewords in Go.
But if you try to teach 9 or 10 year old kids to program you cannot
do this in the language alone, you need at least to import fmt.
On Thursday, 11 April 2019 11:08:16 UTC+2, hui zhang wrote:
>
> I am developing go on mac
> but my test environment is on linux.
>
> Can I build a bin like
> GOOS=linux GOARCH=amd64 go test -c && ./sum.test
>
> and do test on linux , and get a coverage report ?
> how?
>
> Need install go
On Thursday, 4 April 2019 08:49:48 UTC+2, mount...@gmail.com wrote:
>
> hehe, thanks, so if i want understand deeply, need to look up gc code?
>
No, that is not necessary for basics like this question here.
The compiler implements the language spec and the spec describes
how the language works
On Monday, 25 February 2019 23:01:39 UTC+1, DrGo wrote:
>
> what is the fastest possible algorithm to generate a float32
> pseudo-random number in [0.0,1.0)?
> need to generate billions of numbers. Statistical performance and security
> (and even space) are not a priority.
>
If all you care is
There are several issues here.
1. If you use fmt.Println to display a time.Time it will generate a
human readable output but this does _not_ accurately reflect all
technical internal details of a time.Time. It is often a bad idea to
simply dump stuff with fmt.Println.
2. time.Parse and timezones
>
> The UTF8 encoding of that codepoint is three bytes. So the rune will
> still occupy 4 bytes, even if the last byte holds no data?
>
A rune has nothing to do with UTF-8.
A rune stores the codepoint which is totally independent
of any encoding (like UTF-8, UTF-16, UTF-23, EBCDIC, whatnot).
Well, it is good to have exactly one valid format.
With two options like "vN.M.L" and "N.M.L" confusion starts
to spread and why not allow a capital "V" too and a "ú" too
for "útgáfa" and "r" for "release" should be allowed too.
If you start with two options you open up a flood of endless
On Wednesday, 23 January 2019 13:31:13 UTC+1, Victor Giordano wrote:
>
> You wrote
>
>
>> All nil values are perfectly defined: they are the zero value of the
>> particular type.
>
>
> As i see things the nil is the *default value* for the pointers. If you
> want to call it "zero value" to
As emacs has not been recommended yet: Emacs!
V.
On Tuesday, 20 November 2018 21:52:11 UTC+1, Pat Farrell wrote:
>
> I know, this is both a FAQ and an unanswerable question. I'm an old
> programmer who has used nearly every editor known to man. I am not a fan of
> whole-universe IDEs, but can
> Is there a way to force "SomeFunction" to take pointers only at compile
time?
No, sorry.
V.
--
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
Ooops:
This should read
It simply does *NOT* influence the one and only package rule.
On Thursday, 15 November 2018 09:04:01 UTC+1, Volker Dobler wrote:
>
> My opinion on this: You are overthinking it. A lot.
>
> Let's start simple. Cyclic dependencies between packages
>
My opinion on this: You are overthinking it. A lot.
Let's start simple. Cyclic dependencies between packages
are disallowed and whatever you do you packages must not
for an import cycle. This is the only hard rule. Note that this
rule is totally decoupled from the filesystem layout of your
Why is year -1 invalid and what is an "invalid" month
given that 13==1 in Z_12?
V.
On Tuesday, 23 October 2018 16:01:00 UTC+2, Taras D wrote:
>
> Hi,
>
> I was surprised to find the following worked without any reported errors:
>
> t1 := time.Date(-1, 1, 10, 23, 0, 0, 0, time.UTC) // invalid
1 - 100 of 180 matches
Mail list logo