mirror of
https://github.com/kjanat/articulate-parser.git
synced 2026-01-16 09:02:10 +01:00
chore!: prepare for v1.0.0 release
Bumps the application version to 1.0.0, signaling the first stable release. This version consolidates several new features and breaking API changes. This commit also includes various code quality improvements: - Modernizes tests to use t.Setenv for safer environment variable handling. - Addresses various linter warnings (gosec, errcheck). - Updates loop syntax to use Go 1.22's range-over-integer feature. BREAKING CHANGE: The public API has been updated for consistency and to introduce new features like context support and structured logging. - `GetSupportedFormat()` is renamed to `SupportedFormat()`. - `GetSupportedFormats()` is renamed to `SupportedFormats()`. - `FetchCourse()` now requires a `context.Context` parameter. - `NewArticulateParser()` constructor signature has been updated.
This commit is contained in:
@ -34,7 +34,9 @@ func BenchmarkArticulateParser_FetchCourse(b *testing.B) {
|
||||
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(testCourse)
|
||||
// Encode errors are ignored in benchmarks; the test server's ResponseWriter
|
||||
// writes are reliable and any encoding error would be a test setup issue
|
||||
_ = json.NewEncoder(w).Encode(testCourse)
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
@ -57,7 +59,7 @@ func BenchmarkArticulateParser_FetchCourse(b *testing.B) {
|
||||
func BenchmarkArticulateParser_FetchCourse_LargeCourse(b *testing.B) {
|
||||
// Create a large course with many lessons
|
||||
lessons := make([]models.Lesson, 100)
|
||||
for i := 0; i < 100; i++ {
|
||||
for i := range 100 {
|
||||
lessons[i] = models.Lesson{
|
||||
ID: string(rune(i)),
|
||||
Title: "Lesson " + string(rune(i)),
|
||||
@ -90,7 +92,9 @@ func BenchmarkArticulateParser_FetchCourse_LargeCourse(b *testing.B) {
|
||||
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(testCourse)
|
||||
// Encode errors are ignored in benchmarks; the test server's ResponseWriter
|
||||
// writes are reliable and any encoding error would be a test setup issue
|
||||
_ = json.NewEncoder(w).Encode(testCourse)
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
@ -145,7 +149,7 @@ func BenchmarkArticulateParser_LoadCourseFromFile(b *testing.B) {
|
||||
func BenchmarkArticulateParser_LoadCourseFromFile_Large(b *testing.B) {
|
||||
// Create a large course
|
||||
lessons := make([]models.Lesson, 200)
|
||||
for i := 0; i < 200; i++ {
|
||||
for i := range 200 {
|
||||
lessons[i] = models.Lesson{
|
||||
ID: string(rune(i)),
|
||||
Title: "Lesson " + string(rune(i)),
|
||||
|
||||
Reference in New Issue
Block a user