Skip to content

Commit

Permalink
fix go generate
Browse files Browse the repository at this point in the history
Signed-off-by: ikafly144 <[email protected]>
  • Loading branch information
ikafly144 committed Feb 5, 2023
1 parent 042f116 commit 42d7b12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/bot/eventhandlers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/bot/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package gobot

//go:generate go run ./tools/cmd/pkg/bot/eventhandlers/main.go
//go:generate go run ../../tools/cmd/pkg/bot/eventhandlers/main.go

// ボットステータス更新イベント
type StatusUpdate struct {
Expand Down
6 changes: 3 additions & 3 deletions tools/cmd/pkg/bot/eventhandlers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var eventHandlerTmpl = template.Must(template.New("eventHandler").Funcs(template
"constName": constName,
"isDiscordEvent": isDiscordEvent,
"privateName": privateName,
}).Parse(`// "eventhandlers.go"から生成されています; 編集禁止
}).Parse(`// Code generated by genmaps.go; DO NOT EDIT.
// events.go を確認
package gobot
Expand Down Expand Up @@ -68,10 +68,10 @@ func init() { {{range .}}{{if isDiscordEvent .}}

func main() {
var buf bytes.Buffer
dir := filepath.Dir("./pkg/bot/")
dir := filepath.Dir("./")

fs := token.NewFileSet()
parsedFile, err := parser.ParseFile(fs, "pkg/bot/events.go", nil, 0)
parsedFile, err := parser.ParseFile(fs, "events.go", nil, 0)
if err != nil {
log.Fatalf("warning: internal error: could not parse events.go: %s", err)
return
Expand Down

0 comments on commit 42d7b12

Please sign in to comment.