title: Go parsing dates from substring within string
body: <p>I am writing a log file parser, and have written some test code to parse this in C.</p>
  <p>The string to be parsed looks as follows:</p>
  <pre><code>s := `10.0.0.1 Jan 11 2014 10:00:00 hello`
  </code></pre>
  <p>In C, parsing this in place is quite easy. First I find the pointer to the date within the string and then just consume as much as possible using strptime(). This is possible as strptime() will return the position in the string after the call.</p>
  <p>Eventually I decided to go with Go instead of C, but while porting the code over I have some issues. As far as I can tell, time.Parse() does not give me any option to parse from within an existing string (though this can be solved with slices) or indication about how much of the original string it have consumed when parsing the date from within the string.</p>
  <p>Is there any elegant way in Go I can parse the date/time right out of the string without having to first extract the datetime into an exact slice e.g. by returning the number of characters extracted after parsing?</p>