- fix: Rename GetSunDownTime to GetSunSetTime in basic/sun.go and update related calls/outputs - fix: Update test cases to use new method and error constant names - improve: Rename all DownTime/Down functions to SetTime/Set for consistency - improve: Standardize ERR_XXX_NEVER_DOWN error constants to ERR_XXX_NEVER_SET, with ERR_XXX_NEVER_DOWN kept as compatibility alias - improve: More standard naming for interfaces and errors to improve maintainability and readability
		
			
				
	
	
		
			27 lines
		
	
	
		
			535 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			535 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package star
 | 
						|
 | 
						|
import (
 | 
						|
	"b612.me/astro/tools"
 | 
						|
	"fmt"
 | 
						|
	"testing"
 | 
						|
	"time"
 | 
						|
)
 | 
						|
 | 
						|
func TestStar(t *testing.T) {
 | 
						|
	err := InitStarDatabase()
 | 
						|
	if err != nil {
 | 
						|
		t.Fatal(err)
 | 
						|
	}
 | 
						|
	sirius, err := StarDataByHR(2491)
 | 
						|
	if err != nil {
 | 
						|
		t.Fatal(err)
 | 
						|
	}
 | 
						|
	fmt.Printf("%+v\n", sirius)
 | 
						|
	now := time.Now()
 | 
						|
	ra, dec := sirius.RaDecByDate(now)
 | 
						|
	fmt.Println(tools.Format(ra/15, 1), tools.Format(dec, 0))
 | 
						|
	fmt.Println(RiseTime(now, ra, dec, 115, 40, 0, true))
 | 
						|
	fmt.Println(CulminationTime(now, ra, 115))
 | 
						|
	fmt.Println(SetTime(now, ra, dec, 115, 40, 0, true))
 | 
						|
}
 |