Documentation ¶
Overview ¶
* Copyright (c) 2021 The GoPlus Authors (goplus.org). All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright (c) 2021 The GoPlus Authors (goplus.org). All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright (c) 2021 The GoPlus Authors (goplus.org). All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Variables
- func CachePath(m module.Version, suffix string) (string, error)
- func Download(m module.Version) (dir string, err error)
- func DownloadArgs(dir string, args ...string)
- func DownloadDir(m module.Version) (string, error)
- func Edit(name string) (*os.File, error)
- func InitArgs(dir string, args ...string)
- func Read(name string) ([]byte, error)
- func RunGoCmd(dir string, op string, args ...string)
- func TidyArgs(dir string, args ...string)
- func Transform(name string, t func([]byte) ([]byte, error)) (err error)
- type DownloadDirPartialError
Constants ¶
This section is empty.
Variables ¶
var (
GOMODCACHE = env.GOMODCACHE()
)
Functions ¶
func DownloadArgs ¶
func DownloadDir ¶
DownloadDir returns the directory to which m should have been downloaded. An error will be returned if the module path or version cannot be escaped. An error satisfying errors.Is(err, fs.ErrNotExist) will be returned along with the directory if the directory does not exist or if the directory is not completely populated.
func Edit ¶
Edit creates the named file with mode 0666 (before umask), but does not truncate existing contents.
If Edit succeeds, methods on the returned File can be used for I/O. The associated file descriptor has mode O_RDWR and the file is write-locked.
Types ¶
type DownloadDirPartialError ¶
DownloadDirPartialError is returned by DownloadDir if a module directory exists but was not completely populated.
DownloadDirPartialError is equivalent to fs.ErrNotExist.
func (*DownloadDirPartialError) Error ¶
func (e *DownloadDirPartialError) Error() string
func (*DownloadDirPartialError) Is ¶
func (e *DownloadDirPartialError) Is(err error) bool