Socket
Book a DemoInstallSign in
Socket

github.com/dickermoshe/zmanim-core/zmanim_core

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/dickermoshe/zmanim-core/zmanim_core

Source
Go
Version
v0.1.5
Version published
Created
Source

Zmanim Core - Go Bindings

Go bindings for the Zmanim Core library, providing Jewish calendar calculations and zmanim (halachic times) functionality.

Prerequisites

  • Go 1.16 or later
  • CGO enabled (default)

Installation

  • Install the Go package:

    go get github.com/dickermoshe/zmanim-core/zmanim_core
    
  • Download the dynamic libraries from the GitHub releases page

  • Place the library files in your Go project directory:

    • Windows: Copy zmanim_core.dll to the same directory as your Go executable
    • Linux: Copy libzmanim_core.so to your system library path (e.g., /usr/local/lib/) or the same directory as your executable
    • macOS: Copy libzmanim_core.dylib to your system library path or the same directory as your executable
  • Import and use the Go bindings:

package main

import (
	"fmt"
	"time"

	zmanim_core "github.com/dickermoshe/zmanim-core/zmanim_core"
)

func main() {
	msSinceEpoch := time.Now().UnixMilli()
	location := zmanim_core.NewGeolocation(31.768319, 35.213711, 0)
	calendar := zmanim_core.NewAstronomicalCalendar(msSinceEpoch, *location)
	sunrise := calendar.GetSunrise()
	// Parse the sunrise time to a time.Time ms since epoch
	sunriseTime := time.UnixMilli(*sunrise)
	fmt.Println("Sunrise time:", sunriseTime)
}
  • Build and run:
go build -o your_app main.go
./your_app  # On Windows: your_app.exe

Option 2: Static Linking

If you prefer to statically link the Rust library into your Go binary:

  • Download the static libraries from the GitHub releases page

    • Windows: zmanim_core.lib
    • Linux/macOS: libzmanim_core.a
  • Place the static library in your project directory or system library path

  • Build with static linking flags:

# Windows
set CGO_ENABLED=1
set CGO_LDFLAGS=-L. -lzmanim_core
go build -ldflags "-linkmode external -extldflags -static" -o your_app.exe main.go

# Linux/macOS
export CGO_ENABLED=1
export CGO_LDFLAGS="-L. -lzmanim_core"
go build -ldflags "-linkmode external -extldflags -static" -o your_app main.go

Troubleshooting

Common Issues

  • "cannot find library" error:

    • Ensure the dynamic library is in the same directory as your executable
    • On Linux/macOS, you can also add the library path to LD_LIBRARY_PATH
  • CGO compilation errors:

    • Make sure CGO is enabled: export CGO_ENABLED=1 (Linux/macOS) or set CGO_ENABLED=1 (Windows)
    • Verify that you have a C compiler installed (gcc, clang, or MSVC)
  • Static linking issues:

    • Ensure you have the static library file (.lib, .a) not the dynamic one
    • Some systems may require additional system libraries to be linked

License

This project is licensed under the same license as the main Zmanim Core project.

FAQs

Package last updated on 28 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts