Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from TcM1911/setversion
Browse files Browse the repository at this point in the history
Add support for setting a Go version
  • Loading branch information
TcM1911 authored Aug 24, 2019
2 parents 157745d + 682652d commit d823857
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ func close(filePath *C.char) {
removeArena(fp)
}

//export setGoVersion
func setGoVersion(filePath *C.char, version *C.char) C.int {
fp := C.GoString(filePath)
f := getFile(fp)
if f == nil {
return 0
}
ver := C.GoString(version)
err := f.SetGoVersion(ver)
if err != nil {
return 0
}
return 1
}

//export getCompilerVersion
func getCompilerVersion(filePath *C.char) *C.struct_compilerVersion {
fp := C.GoString(filePath)
Expand Down

0 comments on commit d823857

Please sign in to comment.