Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShindouMihou committed Jan 10, 2025
2 parents ec4dda5 + 792be86 commit c344b66
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,27 @@ func main() {
```
Korin scans the codebase (excluding files listed in `.korignore`), preprocesses required files, and outputs them to the configured build directory (default: `.build`).
### Using Korin as a Docker Buildstep
We recommend using Korin as a build step in Dockerfile to ensure that the code is preprocessed before building. To use Korin as a Docker build step, we recommend creating a
file called `cmd/korin_build.go` and adding the following:
```go
package main
import "github.com/ShindouMihou/korin/pkg/korin"
func main() {
korin := korin.New()
// Uncomment to silence the logger (error logs during preprocessing remain unaffected)
// korin.Logger = kbuild.NoOpLogger
korin.DockerBuildStep(".") // Replace with your path to source files if it isn't "."
}
```

Once done, you can add `RUN go run cmd/korin_build.go` as a Docker step and it should preprocess the files beforehand. It is recommended to use this method over `Build` and
related since it will exit the program with an exit code when it fails to preprocess a specific file.

### Plugins
To create a plugin, you can read about it in the [Creating a Plugin](docs/creating_a_plugin.md) documentation, otherwise,
you can check out the [native plugins](pkg/kplugins) that are already available, these should have the `plugin_` prefix on their filenames, by
Expand All @@ -142,4 +163,4 @@ Korin processes a 2,000-4,000 line codebase in under 5-10 milliseconds on averag
Korin is licensed under the [MIT License](LICENSE). You are free to use, modify, and distribute this project in compliance with the license terms.

---
Elevate your Golang projects with Korin's seamless preprocessing capabilities!
Elevate your Golang projects with Korin's seamless preprocessing capabilities!

0 comments on commit c344b66

Please sign in to comment.