NETTİM
← Kod Sonuçlarına Dön
Go PostgreSQL SQL sorguları Fonksiyonlar Dosya işlemleri Sınıflar Lisans: Belirtilmemis

Go — modulewriter.go

Go PostgreSQL entegrasyonlu — SQL sorguları, Fonksiyonlar, Dosya işlemleri. Fonksiyonlar: ToUnexported, NewModuleWriter, WriteModule, writeBuildGoMod, writeUserPackage. SQL sorgusu içerir.
Sınırlı Önizleme Politikası: Bu kodun açık kaynak lisansı doğrulanamadığı için telif kuralları gereği yalnızca kısa önizlemesi gösterilmektedir. Tam kod için orijinal kaynağa gidin ↗.
cmd/plgo/modulewriter.go • Go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"go/ast"
	"go/format"
	"go/parser"
	"go/token"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
)

// ToUnexported changes Exported function name to unexported
func ToUnexported(name string) string {
	return strings.ToLower(name[0:1]) + name[1:]
}

// ModuleWriter writes the tmp module wrapper that will be build to shared object
type ModuleWriter struct {
	PackageName string
	Doc         string
	fset        *token.FileSet
	packageAst  *ast.Package
	functions   []CodeWriter
}

// NewModuleWriter parses the go package and returns the FileSet and AST
func NewModuleWriter(packagePath string) (*ModuleWriter, error) {
	fset := token.NewFileSet()
	// skip _test files in current package
	filtertestfiles := func(fi os.FileInfo) bool {
		if strings.HasSuffix(fi.Name(), "_test.go") {

Tespit Edilen SQL Sorguları

with: go install gitlab.com/microo8/plgo/plgo@latest
with: go install gitlab.com/microo8/plgo/plgo@latest
with PG_MODULE_MAGIC and
with commands to create functions in DB

Benzer Kod Örnekleri

Go — installer.go
Go • SQL sorguları
Go — installer_test.go
Go • SQL sorguları
Go — functions.go
Go • SQL sorguları
Go — channel_example_test.go
Go • Fonksiyonlar