I have a program written in Python (.py) which requires to import and use a function written in Golang (.go) package located in Github repo.
How can I import the .go package module in python code and use the function. The function should accept args from my python code and return a value after doing some operations.
Note: I want to achieve this in Python2.7 version.
go_file.go
// Utility function to get string formed from input list of strings.
func NewFromStrings(inputs []string) string {
// do something
return "abc"
}
python_file.py
# This is just a pseudo code to make problem statement more clear.
import github.com/path_to_package/go_file
str_list = ['abc', 'def']
result = go_file.NewFromStrings(str_list)
print(result)
Thanks in advance :)