Skip to content

Commit 3771954

Browse files
committed
Do the same for program
1 parent 3adeb1f commit 3771954

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ func newBuilder[T any](t promptType, input string) (*builder[T], error) {
2626
var pb promptBuilder
2727
switch t {
2828
case promptUserRequest:
29-
pb = newUserRequest[T](b.input)
29+
pb = newUserRequest[T](input)
3030
case promptProgram:
31-
pb = newProgram[T](b)
31+
pb = newProgram[T](input)
3232
default:
3333
return nil, fmt.Errorf("unknown prompt type %s", t)
3434
}

program.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ indentation and no properties with the value undefined:`
2424
)
2525

2626
type program[T any] struct {
27-
builder *builder[T]
27+
input string
2828
built string
2929
}
3030

31-
func newProgram[T any](b *builder[T]) *program[T] {
32-
return &program[T]{builder: b}
31+
func newProgram[T any](i string) *program[T] {
32+
return &program[T]{input: i}
3333
}
3434

3535
func (b *program[T]) string() (string, error) {
@@ -61,7 +61,7 @@ func (b *program[T]) string() (string, error) {
6161
func (b *program[T]) prompt() string {
6262
var sb strings.Builder
6363
sb.WriteString(newline("The following is a user request:"))
64-
sb.WriteString(newline(b.builder.input))
64+
sb.WriteString(newline(b.input))
6565
sb.WriteString(newline(programPromptInstructions))
6666

6767
return sb.String()

0 commit comments

Comments
 (0)