[][src]Function genco::lang::go::import

pub fn import<M, N>(module: M, name: N) -> Import where
    M: Into<ItemStr>,
    N: Into<ItemStr>, 

Setup an imported element.

Examples

use genco::prelude::*;

let ty = go::import("foo/bar", "Debug");

let toks = quote! {
    #ty
};

assert_eq!(
    vec![
       "import \"foo/bar\"",
       "",
       "bar.Debug",
    ],
    toks.to_file_vec()?
);