srcutil

package
v0.9.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package srcutil provides utilities for working with files under go module.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProjectRoot can read from env
	ProjectRoot = os.Getenv("PROJECT_ROOT")
)

Functions

func LoadFile

func LoadFile(path string) (string, error)

LoadFile reads a file in the repo given its relative path to the root of module and returns a string.

func LoadProto added in v0.8.4

func LoadProto(path string, msg proto.Message) error

LoadProto reads a JSON proto message from a file.

func Path

func Path(path string) string

Path returns the path to a file in the repo given its relative path to the root of the module.

func Read

func Read(path string) ([]byte, error)

Read reads a file in the repo given its relative path to the root of module.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL