Go: switch challenge structs to non-pointers
This commit is contained in:
parent
9d2310ca08
commit
624ca0b6e1
2 changed files with 6 additions and 6 deletions
|
@ -4,14 +4,14 @@ import "errors"
|
|||
|
||||
type BaseChallenge struct{}
|
||||
|
||||
func (b *BaseChallenge) One(instr string) (interface{}, error) {
|
||||
func (b BaseChallenge) One(instr string) (interface{}, error) {
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (b *BaseChallenge) Two(instr string) (interface{}, error) {
|
||||
func (b BaseChallenge) Two(instr string) (interface{}, error) {
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (b *BaseChallenge) Vis(instr string, outdir string) error {
|
||||
func (b BaseChallenge) Vis(instr string, outdir string) error {
|
||||
return errors.New("not implemented")
|
||||
}
|
||||
|
|
|
@ -46,15 +46,15 @@ func run() error {
|
|||
switch task.Part {
|
||||
case runners.PartOne:
|
||||
run = func() (interface{}, error) {
|
||||
return (&chcode.Challenge{}).One(task.Input)
|
||||
return (chcode.Challenge{}).One(task.Input)
|
||||
}
|
||||
case runners.PartTwo:
|
||||
run = func() (interface{}, error) {
|
||||
return (&chcode.Challenge{}).Two(task.Input)
|
||||
return (chcode.Challenge{}).Two(task.Input)
|
||||
}
|
||||
case runners.Visualise:
|
||||
run = func() (interface{}, error) {
|
||||
return "", (&chcode.Challenge{}).Vis(task.Input, task.OutputDir)
|
||||
return "", (chcode.Challenge{}).Vis(task.Input, task.OutputDir)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue