The /v2 suffix is not just for within your code: that's how you need to address
the module (and import its packages) everywhere.
The contents of your go.mod file suggest that your calling code, or perhaps the
`go get` command you used to add the module, is missing that suffix.
--
You received
The function is really just looking up the IP prefixes of the non-routeable
address ranges. It has nothing to do with CIDR, it is for generating a sane
default mask when the user has not specified the mask.
It most definitely should not be deprecated, as these nonrouteable
addresses are definit
I am new to Go so feel free to point out if I am breaking protocol but I
ran into the function DefaultMask() in the net package and did some
research. This function returns the IPMask by assuming that you are using
IP class A, B, and C addresses. But this concept is from the early days of
the I
Doing the following yields no ./app.cov.
Have I got it wrong, or should I file an issue?
$ go test -c -covermode=count -coverpkg ./...
$ ./app.test -apptest localhost:443 -test.coverprofile app.cov
code coverage for v0.0.0 (unreleased)
...
PASS
coverage: 71.7% of statements in ./...
$ ls app.cov
It sounds like you are more asking a question about an inbuilt construct
for performing this conversion, not 'can this be done'. Some are talking
about the use of reflection, but I aver from this and absolutely avoid
reflection at all whenever possible, with the exception of its back-end use
in
There have been multiple long discussions about converting []foo to
[]interface{} in this group. It is not possible. Most of the discussions
apply just as well to your case.
If you really need a "generic" function that does this, and can't convert
as suggested by Louki, then you could use refl
It won't flag any error whatsoever, actually, but if you don't free that
allocation correctly it will not be freed until termination.
On Friday, 1 March 2019 06:36:50 UTC+1, Cholerae Hu wrote:
>
> Consider the following code:
> ```
> package main
>
> /*
> struct B {
> int i;
> };
>
> struct A {
Yes, languages are fluid and these definitions change regularly. I’m not
sure we should keep updating the blog as it will be a maintenance burden. I
doubt this will be the last time things will change. At most add a caveat
that these definitions will change over time.
On Fri, 1 Mar 2019 at 10:16
Algol 68 allowed use before definition which would force more
than one pass but I believe many Algol 68 compilers didn’t allow
this and forced forward declarations much like in C.
I suspect “multiple pass” makes less sense for modern compilers.
When you can keep an entire program in memory, using
yes I can do this in a for loop. but that is not I want.
what I really want to do is "create a function that returns sorted []string
keys from any map[string]... in type safe way".
when I said 'there is no easy way...' , I mean I cannot create that
function easily.
I did not very clarify. sorr
It makes sense to me - since very often many of the parts that are
processed are stand-alone and compile correctly (almost) by themselves
(maybe a package clause to be complete in a source). These smaller pieces
have to have one pass to grab their trees and symbols, and joined to the
other part
On Thu, Feb 28, 2019 at 12:46 AM wrote:
> Thanks, Ian.
>
> I remember reading in some compiler book that languages should be designed
> for a single pass to reduce compilation speed.
>
>
As a guess: this was true in the past, but in a modern setting it fails to
hold.
Andy Keep's phd dissertation
The stack requirements are quite important, I think you have to either take
care of freeing by adding assembler function that does that, or if you can
instead allocate the buffers from Go variable declarations the GC will take
care of it, if it is possible to do this (very likely I think yes, si
Only an assigment to a pre-declared map[string]interface{} in a loop
walking the first layer of that complex map type is required to put the
values into that type, it's not complicated and doesn't have to touch the
template. Something like this:
var MapStringInterface map[string]interface{}
for
Thank you, Mercl.
So there isn't an easy way, you mean, right?
2019년 3월 2일 토요일 오후 6시 45분 8초 UTC+9, Jan Mercl 님의 말:
>
> On Sat, Mar 2, 2019 at 10:32 AM 김용빈 >
> wrote:
>
> > but it seems the argument is not automatically converted.
>
> Things are automatically converted to a different type in Go o
On Sat, Mar 2, 2019 at 10:32 AM 김용빈 wrote:
> but it seems the argument is not automatically converted.
Things are automatically converted to a different type in Go only when they
are assigned to, or passed as arguments of, interface types.
> manual type cast `map[string]interface{}(myMap)` also
I wanted sorted key of a map, of course I can do this.
// myMap => map[string]map[string]Something
keys := make([]string, 0)
for k := range myMap {
keys = append(keys, k)
}
but what I want is make this a function.
func sortedKeys(m map[string]interface{}) {
keys := make([]string, 0)
17 matches
Mail list logo