leetcode-cli icon indicating copy to clipboard operation
leetcode-cli copied to clipboard

[Feature Request] Use custom code template and filter some lines when submit code

Open hiberabyss opened this issue 7 years ago • 2 comments

Is it possible to use custom template instead of the default code template?

When wrote go code, I would like to write some unit test to run the code locally, to accomplish this, the line package main need to be added into the source file. It would be convenient if I could generate go code with following template:

package main
<%= code %>

Then when submit code, the line package main should be filtered out.

Thanks!

hiberabyss avatar Jun 24 '18 13:06 hiberabyss

What you expected sound like a plugin as what https://github.com/skygragon/leetcode-cli-plugins/blob/master/docs/cpp.run.md does. And I'm afraid you might need more stub codes than a single "package main" to make go your go code running locally (e.g. definition for tree/list used in leetcode.com)?

skygragon avatar Jul 03 '18 02:07 skygragon

Also would appreciate if you or someones would share your new template as a "go.run" plugin if possible. :p

skygragon avatar Jul 03 '18 02:07 skygragon