How to call go from python

How to call go from python

How to call go from python? Following is an example. but I want handle a list, or define a function returning a list.

How to call go from python? Following is an example. but I want handle a list, or define a function returning a list.


package main

import "C"

// go build -buildmode=c-shared -o path/test.so path/main.go

import (    "fmt"    "C" )

/* Define Circle */ type Circle struct {   Radius float64 }

//define method for Circle func (c Circle) getArea() float64 {   return 3 * c.Radius * c.Radius }

func (c Circle) setRadius(r float64) {   c.Radius = r }

//export test func test(r float64) {   var c1 = Circle{Radius: r}   fmt.Println("r = ", r)   fmt.Println("r = ", c1.Radius)   fmt.Println("S = ", c1.getArea()) }

func main() {     //test(3) }

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Go Programming and Why should you learn Go Language?

Go provides you high performance like C/C++, super efficient concurrency handling like Java and fun to code like Python/Perl. Go with Golang and why go is the best programming language in the world and Why should you learn Go Language?

Rust vs. Go: Should I Rust, or Should I Go

Well both Rust and Go provide amazing performance. Should you write you’re next big thing with Rust or with Go? Go is fast and powerful, but it avoids bogging the developer down, focusing instead on simplicity and uniformity. Rust. If on the other hand, wringing out every last ounce of performance is a necessity, then Rust should be your choice. Rust is more of a competitor to C++ than it is with Go.