loov / goda

Go Dependency Analysis toolkit
MIT License
1.37k stars 45 forks source link

#62 Provide default value when node repo fails to resolve #64

Closed equinoxmatt closed 2 years ago

equinoxmatt commented 2 years ago

Sorry, I messed up the previous PR #63

I have made the fix suggested by @egonelbre - it now creates a default node.Repo struct value if error occurs.

I will re-add the repo code here for testing:

package main

import (
    "gorm.io/gorm/logger"
)

type Writer struct {
}

func (w Writer) Printf(format string, v ...interface{}) {
}

// main function
func main() {
    _ = logger.New(
        Writer{}, // io writer
        logger.Config{},
    )
}
egonelbre commented 2 years ago

Thank you :)