Skip to content

Commit

Permalink
Allow importing parse tree proto with cgo disabled (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored Dec 2, 2023
1 parent e2b23fa commit 7972fca
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions benchmark_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package pg_query_test

import (
Expand Down
3 changes: 3 additions & 0 deletions fingerprint_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package pg_query_test

import (
Expand Down
6 changes: 3 additions & 3 deletions makefuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ func MakeAConstStrNode(str string, location int32) *Node {
return &Node{
Node: &Node_AConst{
AConst: &A_Const{
Val: &A_Const_Sval {
Val: &A_Const_Sval{
Sval: &String{Sval: str},
},
Isnull: false,
Isnull: false,
Location: location,
},
},
Expand All @@ -26,7 +26,7 @@ func MakeAConstIntNode(ival int64, location int32) *Node {
return &Node{
Node: &Node_AConst{
AConst: &A_Const{
Val: &A_Const_Ival {
Val: &A_Const_Ival{
Ival: &Integer{Ival: int32(ival)},
},
Isnull: false,
Expand Down
3 changes: 3 additions & 0 deletions normalize_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package pg_query_test

import (
Expand Down
3 changes: 3 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package pg_query_test

import (
Expand Down
2 changes: 2 additions & 0 deletions parser/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package parser includes the actual parsing logic using cgo to access libpg_query.
package parser
3 changes: 3 additions & 0 deletions pg_query.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package pg_query

import (
Expand Down

0 comments on commit 7972fca

Please sign in to comment.