While Trish directly answers the G-Code part of your question, my answer offers an alternative if you use Marlin. RepRap has a similar feature called pressure advance, but this answer is focusing on Marlin's feature.
According to Marlin:
Under default conditions, extruder axis movement is treated in the same way as the XYZ linear axes. The extruder motor moves in linear proportion to all the other motors, maintaining exactly the same acceleration profile and start/stop points. But an extruder is not a linear system, so this approach leads, most obviously, to extra material being extruded at the end of each linear movement.
In short, corners result in being rounded instead of sharp due to the constant extrusion when laying down a line. One can mitigate this by changing the flow, though this might affect straight lines in other parts of the print, namely under extruding them. Marlin's answer to this is linear advance.
With linear advance, the extrusion rate changes as the print head speed changes. When the print head moves faster, more plastic has to be pushed out to lay a consistent line and as soon as the head slows down, the extrusion rate slows down to compensate. The print should then have a consistent line. This is all done using a new factor called k. From Marlin:
K is now a meaningful value with the unit [mm of filament compression needed per 1mm/s extrusion speed] or [mm/mm/s].
One can determine the k value for their printer using Marlin's k calibration tool which prints out multiple straight lines and instructs the printer to print the start of each line slowly, then print fast, and end the line slow again. Each line has a different k value and the user chooses the k value from the line that is most consistent.
Some caveats
Bowden style extruders require larger k values which, even then, linear advancing may not work. This is due to the bowden tube itself and the material between the extruder motor and the hot end. This is along the same issue as trying to print flexible plastics with a bowden extruder. While linear advance is better suited for direct drives, it's not impossible to use it on a bowden.
Setting up linear advance requires an extra set of tuning. While this primarily means tuning the k value, print speeds may need adjusting (potentially allowing for faster speeds even).
Older linear advance version, at least on Marlin, had the extruder motor a lot more active. Some people report that printing is noticeably noisier. This feature might also add an extra load to the CPU. These issues should not be a problem anymore, as of v1.5, but YMMV.
One needs to change the firmware/G-Code so that each print can use linear advance. If the printer is only using one material the firmware can be changed. However, if multiple materials will be used within the printer's lifetime, the G-Code will have to include the following command at the end of the start script ( more found here). This k value will be different for each material. An example of the command is as follows:
M900 K75 ; Set k-factor for PLA
The link also recommends setting the k factor value to 0 when turning the feature on in the firmware. This essentially disables the hard-coded value in the firmware.
Finally, slicer settings like pressure advance, Coast at end, extra restart length after retract should be disabled when using linear advance as they do a similar operation. On the flip side, these settings may work for your printer so you may not need to even use linear advance.