go-swetest is the simple wrapper of swisseph library's swetest.
go get -u github.com/DestinyLab/go-swetest
You can download the ephemeris files to specifically directory (default same as binary
).
package main
import (
"fmt"
"log"
"github.com/DestinyLab/go-swetest"
)
func main() {
opt := []string{
"-edir./resources/",
"-b11.11.2017",
"-ut00:00:00",
"-p0",
"-fZ",
"-eswe",
"-head",
}
s := swetest.New()
res, err := s.Query(opt)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", res)
}
- Swetest test page: http://www.astro.com/swisseph/swetest.htm
- Help: http://www.astro.com/cgi/swetest.cgi?arg=-h&p=0
- ephemeris files: ftp://ftp.astro.com/pub/swisseph/ephe/