lightweightCrontab creates a copy of Crontab without the Lines field to prevent circular references
()
| 915 | |
| 916 | // lightweightCrontab creates a copy of Crontab without the Lines field to prevent circular references |
| 917 | func (c *Crontab) lightweightCopy() Crontab { |
| 918 | return Crontab{ |
| 919 | User: c.User, |
| 920 | IsUserCrontab: c.IsUserCrontab, |
| 921 | Filename: c.Filename, |
| 922 | Lines: nil, // Explicitly nil to break circular reference |
| 923 | TimezoneLocationName: c.TimezoneLocationName, |
| 924 | Shell: c.Shell, |
| 925 | UsesSixFieldExpressions: c.UsesSixFieldExpressions, |
| 926 | } |
| 927 | } |
| 928 | |
| 929 | // buildCrontabCommand builds a crontab command with appropriate user flag if needed |
| 930 | func (c Crontab) buildCrontabCommand(args ...string) *exec.Cmd { |
no outgoing calls