Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor generate package #442

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions generate/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

//go:generate go run ../generate

// This should not be included in any release of pelican

// Include more generator functions here but keep them encapsulated
// in their separate files under `generate` package
func main() {
GenParamEnum()
GenParamStruct()
GenPlaceholderPathForNext()
}
2 changes: 2 additions & 0 deletions generate/next_generator.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package main

// This should not be included in any release of pelican

import (
"log"
"os"
Expand Down
6 changes: 0 additions & 6 deletions generate/param_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ type TemplateData struct {
GeneratedCode string
}

func main() {
GenParamEnum()
GenParamStruct()
GenPlaceholderPathForNext()
}

var requiredKeys = [3]string{"description", "default", "type"}

func GenParamEnum() {
Expand Down
2 changes: 0 additions & 2 deletions param/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/spf13/viper"
)

//go:generate go run ../generate

var (
viperConfig *config
configMutex sync.RWMutex
Expand Down
Loading