@@ -445,8 +445,8 @@ var generateCmd = &cobra.Command{
445
445
if sample == "" {
446
446
if err := survey .AskOne (& survey.Select {
447
447
Message : "Choose the language you'd like to use:" ,
448
- Options : []string {"JavaScript " , "Go " , "Python" },
449
- Default : "JavaScript " ,
448
+ Options : []string {"Nodejs " , "Golang " , "Python" },
449
+ Default : "Nodejs " ,
450
450
Help : "The project code will be in the language you choose here." ,
451
451
}, & language ); err != nil {
452
452
return err
@@ -457,15 +457,10 @@ var generateCmd = &cobra.Command{
457
457
} else if len (sampleList ) > 0 {
458
458
const generateWithAI = "Generate with AI"
459
459
460
- lang := strings .ToLower (language )
461
460
sampleNames := []string {generateWithAI }
462
461
sampleDescriptions := []string {"Generate a sample from scratch using a language prompt" }
463
462
for _ , sample := range sampleList {
464
- sampleLangs := make ([]string , len (sample .Languages ))
465
- for _ , l := range sample .Languages {
466
- sampleLangs = append (sampleLangs , strings .ToLower (l ))
467
- }
468
- if slices .Contains (sampleLangs , lang ) {
463
+ if slices .ContainsFunc (sample .Languages , func (l string ) bool { return strings .EqualFold (l , language ) }) {
469
464
sampleNames = append (sampleNames , sample .Name )
470
465
sampleDescriptions = append (sampleDescriptions , sample .ShortDescription )
471
466
}
0 commit comments