(key string)
| 428 | } |
| 429 | |
| 430 | func (c *configAST) createMemberIfMissing(key string) *hujson.ObjectMember { |
| 431 | i := c.memberIndex(c.root.Value.(*hujson.Object), key) |
| 432 | if i == -1 { |
| 433 | c.root.Value.(*hujson.Object).Members = append(c.root.Value.(*hujson.Object).Members, hujson.ObjectMember{ |
| 434 | Name: hujson.Value{ |
| 435 | Value: hujson.String(key), |
| 436 | BeforeExtra: []byte{'\n'}, |
| 437 | }, |
| 438 | }) |
| 439 | i = len(c.root.Value.(*hujson.Object).Members) - 1 |
| 440 | } |
| 441 | return &c.root.Value.(*hujson.Object).Members[i] |
| 442 | } |
| 443 | |
| 444 | func mapToObjectMembers(env map[string]string) []hujson.ObjectMember { |
| 445 | members := make([]hujson.ObjectMember, 0, len(env)) |
no test coverage detected