On Tuesday, March 21, 2017 at 4:04:34 AM UTC+1, Rob 'Commander' Pike wrote:
>
> No, Go does not have run-time evaluation of Go program source. It is
> strictly a compiled language, although there are some (pieces of)
> interpreters out there.
>
>
>
However, Go 1.8 has plugins
Thanks Harley.
I will pick your example and will see if this is do-able...
Sandeep
Best Regards,
Sandeep Kalra
On Mon, Mar 20, 2017 at 11:48 PM, Harley Laue
wrote:
> I have some code that I've sat on for some time:
>
> type Cell int
> type Function func() error
hi ,
I am also having the same problem, can you please elaborate
invalid operation: dat["connections"]["current"] (type interface {} does
not support indexing)
Thanks
On Friday, August 21, 2015 at 4:22:22 PM UTC+5:30, Giulio Iotti wrote:
>
> On Friday, August 21, 2015 at 11:51:32 AM UTC+2,
I have some code that I've sat on for some time:
type Cell int
type Function func() error
func cellToFunction(c Cell) *Function {
p := unsafe.Pointer(uintptr(c))
if p == nil { return nil }
return (*Function)(p)
}
func functionToCell(w *Function) Cell {
return
Thanks Rob!
On Monday, March 20, 2017 at 10:04:34 PM UTC-5, Rob 'Commander' Pike wrote:
>
> No, Go does not have run-time evaluation of Go program source. It is
> strictly a compiled language, although there are some (pieces of)
> interpreters out there.
>
> -rob
>
>
> On Mon, Mar 20, 2017 at
No, Go does not have run-time evaluation of Go program source. It is
strictly a compiled language, although there are some (pieces of)
interpreters out there.
-rob
On Mon, Mar 20, 2017 at 7:57 PM, Sandeep Kalra
wrote:
> Is there any option to convert []byte to func
Is there any option to convert []byte to func (Assuming that []byte
carries valid function)
package main
import (
"fmt"
"io/ioutil"
)
func run(b []byte) {
/// HERE ?
}
func main() {
if b, e := ioutil.ReadFile("./file.go"); e != nil {
fmt.Println(e)
} else {
Check out https://github.com/go-martini/martini if you're looking for some
magic.
In case you don't find any magic there, then i'm sorry, i've havne't used
martini myself, and am not familiar with its source, i've only heard from
others that it's quite magicky.
--
You received this message
What you're looking for is reflect.Type.NumIn()int and reflect.Type.In(i
int) Type.
See example here https://play.golang.org/p/q1D56Abj-5
On Tuesday, March 21, 2017 at 12:01:09 AM UTC+1, Tyler Compton wrote:
>
> I'm trying to create an HTTP request router library that automatically
> decodes
Ok thanks I saw that post but didn't read down far enough, I am using
golang v1.8 and GCC-7.0 and most of the refs in that post were golang v1.6
and GCC-6.x. At the tail end there was some refs to golang v1.7 as
you say. Issue has been around for almost a year I guess.
Ended up switching to
Hi,
As part of preparing an internal go talk to explain using strings vs bytes
of the bufio.Scanner, I created two small samples
https://play.golang.org/p/-TYycdHaPC and
https://play.golang.org/p/L7W-jiaHdL , the only difference in the hot path
is reducing the conversions from `[]byte` to
On Sat, Mar 18, 2017 at 12:03 PM, T L wrote:
>
> At the end of sync/atomic package docs, it says
>
> On x86-32, the 64-bit functions use instructions unavailable before the
> Pentium MMX.
>
>
> On non-Linux ARM, the 64-bit functions use instructions unavailable before
> the
On Mon, Mar 20, 2017 at 4:25 PM, Ian Lance Taylor wrote:
> On Mon, Mar 20, 2017 at 4:17 PM, Richard D'Addio wrote:
>> With gccgo I get the following error the same builds fine with gc:
>>
>> //with native
>>
>>
On Mon, Mar 20, 2017 at 4:17 PM, Richard D'Addio wrote:
> With gccgo I get the following error the same builds fine with gc:
>
> //with native
>
> /home/rdaddio/mynewclient/clone_gobotics/gobotics/go/pkg/tool/linux_amd64/compile
> -o $WORK/github.com/hashicorp/go-multierror.a
On Mon, 2017-03-20 at 09:45 +0100, 'Axel Wagner' via golang-nuts wrote:
> The "philosophy of gofmt" was to end arguments about how go code
> should be formatted.
> Which gives this thread a special form of irony :)
People will always adjust their behaviour to minimise the delta on
their
With gccgo I get the following error the same builds fine with gc:
*//with native*
/home/rdaddio/mynewclient/clone_gobotics/gobotics/go/pkg/tool/linux_amd64/compile
-o $WORK/github.com/hashicorp/go-multierror.a -trimpath $WORK -p
github.com/hashicorp/go-multierror -complete -buildid
On Sun, Mar 19, 2017 at 3:29 PM, wrote:
>
> I am tinkering with some runtime code and I would like to build only the go
> binary to the test it on a small program I wrote. I don't see any script in
> the source that would allow that, all of these also try to compile the
>
Also, if there already exists a library that does this kind of magic for
REST APIs, I'd love to hear about it.
On Mon, Mar 20, 2017 at 4:01 PM Tyler Compton wrote:
> I'm trying to create an HTTP request router library that automatically
> decodes parameters in the request URL
On Mon, Mar 20, 2017 at 4:51 AM, Song Liu wrote:
>
> I am going to write a shared library using the Go, you know that the Go
> runtime and used libraries are compiled into the library together.
>
> But it seems that all the symbols from this library is "DEFAULT", is there a
>
I'm trying to create an HTTP request router library that automatically
decodes parameters in the request URL and passes them as arguments to the
handler function. It would theoretically make something like this possible:
myRouter.HandleFunc("/getPuppies/{id}", func(w http.ResponseWriter, r
Sorry in advance if this is the wrong list for this.
I can build the gobot.io code below with the golang v1.8 and the standard
compiler:
go version go1.8 linux/amd64
go build -work -x hello_blink.go
But when I try to build with the GCC option in the same scenario it fails.
I am using
Stable Version : gopkg.in/resty.v0
Edge Version : https://github.com/go-resty/resty
godoc : https://godoc.org/github.com/go-resty/resty
*This release brings following:*
*Releases Notes:* https://github.com/go-resty/resty/releases/latest
*Feature:*
- Request based on SRV record
I'm using this method to extract and get the public key string from an
original ssh private key. They key ends up to be broken/badly formatted.
I've checked it against the key generated by ssh-keygen and the first few
chars are different. Anyone has any ideas?
func ExtractPublicKey(der []byte)
Hello, I am writing this application, where I can store some reminders for
myself in CLI to not forget something important.
My question is how can I save my input data or lets say what's the best way
to do so? I've tried JSON, but it didnt work out, primarily because I cant
really figure it
Stable Version : gopkg.in/resty.v0
Edge Version : https://github.com/go-resty/resty
godoc : https://godoc.org/github.com/go-resty/resty
*This release brings following:*
*Releases Notes:* https://github.com/go-resty/resty/releases/latest
*Feature:*
- Request based on SRV record
T L,
For example: https://play.golang.org/p/BSwB8jQwBY
Peter
On Monday, March 20, 2017 at 1:24:46 PM UTC-4, peterGo wrote:
>
> s/strcts/structs/
>
> On Monday, March 20, 2017 at 1:24:06 PM UTC-4, peterGo wrote:
>>
>> TL,
>>
>> https://golang.org/ref/spec#Size_and_alignment_guarantees
>>
>> For
s/strcts/structs/
On Monday, March 20, 2017 at 1:24:06 PM UTC-4, peterGo wrote:
>
> TL,
>
> https://golang.org/ref/spec#Size_and_alignment_guarantees
>
> For eample, some strcts.
>
> Peter
>
> On Monday, March 20, 2017 at 11:23:02 AM UTC-4, T L wrote:
>>
>> Or if the first element in an array is
TL,
https://golang.org/ref/spec#Size_and_alignment_guarantees
For eample, some strcts.
Peter
On Monday, March 20, 2017 at 11:23:02 AM UTC-4, T L wrote:
>
> Or if the first element in an array is 64bit aligned and the size of array
> elements is 8N bytes,
> is it for sure that all elements in
https://github.com/jteeuwen/go-bindata is the one I see most often. There
are several alternatives listed in the README
at https://github.com/shurcooL/vfsgen
On Monday, March 20, 2017 at 12:02:47 PM UTC-4, Francesco Lazzarino wrote:
>
> Hi,
>
> I made a handy tool that converts a file in a pkgs
Hi,
I made a handy tool that converts a file in a pkgs to a src file with a
[]byte var. Then you can compile arbitrary files into a pkg. I found it
handy for use via go generate.
https://github.com/flazz/togo
If this is a solved problem (or a bad approach) let me know, I'll amend the
README
Or if the first element in an array is 64bit aligned and the size of array
elements is 8N bytes,
is it for sure that all elements in the array are 64bit aligned?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and
I have an implementation of a storage interface for
github.com/RangelReale/osin that I would like to be able to test each
function in isolation. One of the aspects of the interface is that certain
functions must return with data loaded that other functions are responsible
for returning in the
The following may help:
http://feisky.xyz/2016/04/19/cgo-in-go-1-6/
On 20/03/2017 13:25, Song Liu wrote:
Hi,
I have a shared lib as bellow:
|
/*
#include
structMedia{
char*Name;
char*Path;
uint64_tSize;
};
*/
import"C"
//exportGetMediaFromDB
funcGetMediaFromDB(filename*C.char)*C.struct_Media{
Hi,
I have a shared lib as bellow:
/*
#include
struct Media {
char*Name;
char*Path;
uint64_t Size;
};
*/
import "C"
//export GetMediaFromDB
func GetMediaFromDB(filename *C.char) *C.struct_Media {
c_struct_media := _Media{}
return c_struct_media
}
Hi,
I am going to write a shared library using the Go, you know that the Go
runtime and used libraries are compiled into the library together.
But it seems that all the symbols from this library is "DEFAULT", is there
a way to use the "HIDDEN" symbol visibility by default, but "DEFAULT" only
On Sun, 19 Mar 2017 13:51:05 -0700 (PDT)
aktungmak wrote:
> I am trying to write a function that initializes a generic
> collection. For adding new items to the collection, the user
> specifies a constructor which takes one argument and returns a
> pointer to the struct that
The "philosophy of gofmt" was to end arguments about how go code should be
formatted.
Which gives this thread a special form of irony :)
On Mon, Mar 20, 2017 at 1:59 AM, Wojciech S. Czarnecki
wrote:
>
> > > On Sun, 19 Mar 2017, at 09:35 PM, Rob Pike wrote:
> > > everyone will
Hello all,
Here are some thoughts and questions about plugins in Go 1.8 (which I use
on Linux/x86-64).
*Plugins in other languages*
In C and C++ code (on Linux), plugins are practically not exactly the same
as e.g. shared objects (a good reference would be Drepper's *How To Write
Shared
38 matches
Mail list logo