How to call go function from java?
问题 How to call go function from java? package main import "fmt" import "C" //export Add func Add(x, y int) int { fmt.Printf("Go says: adding %v and %v\n", x, y) return x + y } 回答1: After review of the documentation about Go Shared Libraries It is possible to integrate the call Golang functions from Java Spring Batch, below a short example: Golang function: package main import "fmt" import "C" //export Add func Add(x, y int) int { fmt.Printf("Go says: adding %v and %v\n", x, y) return x + y }