mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Use rake to build generated code
This commit is contained in:
parent
93cc21199f
commit
6c7f1593e8
10
Rakefile
Normal file
10
Rakefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
require "erb"
|
||||||
|
|
||||||
|
rule '.go' => '.go.erb' do |task|
|
||||||
|
erb = ERB.new(File.read(task.source))
|
||||||
|
File.write(task.name, "// Do not edit. Generated from #{task.source}\n" + erb.result(binding))
|
||||||
|
sh "goimports", "-w", task.name
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Generate code"
|
||||||
|
task generate: ["pgtype/int_scan_plans.go"]
|
@ -1,3 +1,4 @@
|
|||||||
|
// Do not edit. Generated from pgtype/int_scan_plans.go.erb
|
||||||
package pgtype
|
package pgtype
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user