(cfg idStrategyConfig)
| 462 | } |
| 463 | |
| 464 | func getIDStrategyExamples(cfg idStrategyConfig) idStrategyExamples { |
| 465 | switch cfg.strategy { |
| 466 | case "prefixed": |
| 467 | p := cfg.prefix |
| 468 | return idStrategyExamples{ |
| 469 | exampleID: fmt.Sprintf("%s-001", p), |
| 470 | exampleFilename: fmt.Sprintf("%s-015-add-user-auth.md", p), |
| 471 | filePattern: fmt.Sprintf("%s-NNN-descriptive-title.md", strings.ToUpper(p)), |
| 472 | } |
| 473 | case "random": |
| 474 | return idStrategyExamples{ |
| 475 | exampleID: "a3f9x2", |
| 476 | exampleFilename: "a3f9x2-add-user-auth.md", |
| 477 | filePattern: "ID-descriptive-title.md", |
| 478 | } |
| 479 | case "ulid": |
| 480 | return idStrategyExamples{ |
| 481 | exampleID: "01h5a3mpk", |
| 482 | exampleFilename: "01h5a3mpk-add-user-auth.md", |
| 483 | filePattern: "ID-descriptive-title.md", |
| 484 | } |
| 485 | default: // sequential |
| 486 | return idStrategyExamples{ |
| 487 | exampleID: "001", |
| 488 | exampleFilename: "015-add-user-auth.md", |
| 489 | filePattern: "NNN-descriptive-title.md", |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | // applyIDStrategyReplacements replaces sequential-style placeholders in template content. |
| 495 | func applyIDStrategyReplacements(content []byte, examples idStrategyExamples) []byte { |
no outgoing calls