Here is a code:
package main
import (
"fmt"
"log"
"net"
)
func main() {
l, err := net.Listen("tcp", "[::]:9090")
if err != nil {
log.Fatal(err)
}
defer l.Close()
go func() {
for {
l.Accept()
}
}()
c, err :=
To answer the first point - the keyword is "*assignable*" here - an slice
[]int{1,23} is not assignable to a slice []I where I is a type of int.
See https://golang.org/ref/spec#Assignability
( also golang treats slices as types in themselves
ie https://golang.org/ref/spec#SliceType )
Hey nuts!
I ran into the following confusion
today: https://play.golang.org/p/XH8wyj6IbT.
Consulting the golang spec, I think this is correct. `If the final argument
is assignable to a slice type []T, it may be passed unchanged as the value
for a ...T parameter if the argument is followed by
Hi,
https://github.com/santhosh-tekuri/jsonschema
I created JSONSchema Validator in GO.
It implements Draft4 and passes all tests including optional one in
https://github.com/json-schema/JSON-Schema-Test-Suite
Looking for feedback. Let me know if you find this useful.
Thanks
Santhosh Kumar
On Saturday, 3 June 2017 13:11:04 UTC+3, mhh...@gmail.com wrote:
>
> Hi,
>
> yes generics / not generics.
>
> That is, in what i proposed, only the consumer is enhanced, thus generics
> are not required anymore on the declarer, except for this conv method,
> indeed.
>
> also as the declarer can
for the fun, with early return,
https://play.golang.org/p/I9AORKOYQm
On Saturday, June 3, 2017 at 12:34:15 PM UTC+2, mhh...@gmail.com wrote:
>
> > Generics enable more than just replacing loops. For example, they can
> enable libraries of generic algorithms to be used with any type of array.
>
>From https://blog.golang.org/gobs-of-data
"The first time you encode a value of a given type, the gob package builds
a little interpreted machine specific to that data type. It uses reflection
on the type to construct that machine, but once the machine is built it
does not depend on
On 2017-06-02 19:24:40, Michael Brown wrote:
Do you have any references on the stability of the current plugin system
that I can use for reference? I'm building a system now that I contemplate
using with some plugins and I'd like to know up front the challenges.
I wrote a blogpost on plugins
Hi Adam,
Back in 2014 I had the same driving motives like you and I ended up writing
my own generator for Postgres (to deal with tables, views, and functions,
for the basic types):
https://github.com/silviucm/pgtogogen
Thanks Jan!
You are great!
On Saturday, 3 June 2017 13:00:51 UTC+2, Jan Mercl wrote:
>
> On Sat, Jun 3, 2017 at 12:42 PM Harry
> wrote:
>
> > How can I handle to write something out using bufio.NewWriter?
>
> Just fine. The problem is you haven't created any file to write
On Sat, Jun 3, 2017 at 12:42 PM Harry wrote:
> How can I handle to write something out using bufio.NewWriter?
Just fine. The problem is you haven't created any file to write to in the
first place, which checking the error could have told you.
--
-j
--
You received this
Hi guys,
How can I handle to write something out using bufio.NewWriter?
My code is like below,
var writer *bufio.Writer
var err error
file, _ := os.OpenFile(*fileName, os.O_WRONLY | os.O_APPEND, 0644)
defer file.Close()
writer = bufio.NewWriter(file)
> Generics enable more than just replacing loops. For example, they can
enable libraries of generic algorithms to be used with any type of array.
Here's an example:
in my demonstration every type got this kind of method,
the problem become how do you jump from Type A to type B.
in []A to []B or
yes true.
I m not sure i intend to change that asap,
but this another topic,
i want not deep into right now.
That being said again agreed, understood, prone to happen, maybe.
On Friday, June 2, 2017 at 12:05:52 PM UTC+2, Egon wrote:
>
> On Friday, 2 June 2017 12:06:54 UTC+3, mhh...@gmail.com
The best real world example I know of mixing cgo and plugins is
https://github.com/eawsy/aws-lambda-go-shim and it works pretty well.
It compiles a go program as a native library using cgo, which is loading some
more golang code compiled as a plugin.
The native library also happens to
fuser(1) will tell you for a file
netstat(1) -anp will do for sockets
--
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.
Thanks! This should be very useful.
Sometimes I want to know the inverted answer that which process is using a port
or a file.
--
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,
How is cgo involved here? What kind of keys are you using?
--
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
18 matches
Mail list logo